Lu
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Lu on 11/22/2024 in #questions
Zustand /w persist + immer, not persisting multi-tenant.
saved
should be persisting through different tenants, but it gets cleared every time. It should retrieve the persisted state and update it no? https://pastecord.com/oragaziboh.typescript2 replies
Do I need a server to use tRPC?
Since we use RQ at work for our product - I thought might as well bring tRPC into it since it couples things very well. We dont do anything serverless on the frontend, so curious if I need to install an adapter to Vite and spin up a server?
2 replies
DTDrizzle Team
•Created by Lu on 6/21/2024 in #help
limiting json_agg
Having a bit of a skill issue limiting the amount of data returned from
json_agg
I tried to add a subquery, but I can't seem to get it right1 replies
CDCloudflare Developers
•Created by Lu on 6/8/2024 in #general-help
Queues + DO's + DB connections
I distribute load to multiple different unique DO's, where each one creates a new connection. I keep getting
PostgresError: Max client connections reached
. I was under the impression that after DB operations are done, it will automatically close the connection by itself.
My thinking is to spawn a unique durable object for insertions, and to keep it alive throughout my distribution process so i can minimize the amount of connections it opens.
Any advice?1 replies
CDCloudflare Developers
•Created by Lu on 6/3/2024 in #general-help
Having such a bad experience with Queues & DOs
I have a lot of data to fetch from an external API.
I queue up each page which then distributes additional processing via durable objects.
It starts out perfectly fine, but once it reaches half of the pages it needs to process, it just hangs.
Each page has a unique shared ID to keep durable objects alive for in-memory state. After a page finishes fetching, I dispose the DO.
Is there something I am not understanding?
(this is all local & using RPC )
1 replies
CDCloudflare Developers
•Created by Lu on 6/3/2024 in #workers-help
An RPC result was not disposed properly
I have a DO that returns an object and is marked as
Disposable
. I keep getting this error, and i'm not entirely sure how to go about it, because I thought it automatically disposes?
1 replies
CDCloudflare Developers
•Created by Lu on 5/30/2024 in #general-help
Best way to retrieve Queue List within a CF worker?
I know there is a Queue API that you can fetch from a CF worker, but is there another way to do so?
2 replies
CDCloudflare Developers
•Created by Lu on 5/26/2024 in #general-help
attach a payload to queue batch rather than each message?
With CF queues, are you able to send a payload that’s attached to the actual batch, rather than each message?
I would like to send a userId for example to the controller, rather than to each consumer message.
3 replies
DTDrizzle Team
•Created by Lu on 5/23/2024 in #help
Rename conflicted column (postgres)
I am having a bit of trouble getting this to work.
Error I get
1 replies
CDCloudflare Developers
•Created by Lu on 5/21/2024 in #general-help
best approach to apply pollyfills?
A library I want to use within a CF worker imports “crypto”, so I need to apply a pollyfill that will use node:crypto instead. I’ve never messed around with pollyfills so I am not sure how to go about this correctly.
3 replies
TTCTheo's Typesafe Cult
•Created by Lu on 5/9/2024 in #questions
TRPC deserialization cuts off long string to client
I got an oauth2 URL that’s very long because scopes are added as search params. The URL returned to the client is cut off completely. Not sure how to go about this. Is this related to superjson somehow?
1 replies
CDCloudflare Developers
•Created by Lu on 12/14/2023 in #workers-help
How does tiered caching work in the CF worker other than enabling it?
This is what I understand in terms of control
Workers have in-memory cache of x mb's, so you can define a memory cache via
If your data does not exist in both of those, tiered caching comes into play, and from my understanding its tied to the
new Map
for example.
Workers can use Cache API
via caches.default.put
Both of these exist locally via colocation, so in-memory cache is going to be fastest, and then colo
cache is second fastest in terms of latency for data retrieval.If your data does not exist in both of those, tiered caching comes into play, and from my understanding its tied to the
fetch api
.
What does this mean exactly? Would love a code example of the breakdown for:
14 replies
CDCloudflare Developers
•Created by Lu on 8/18/2023 in #general-help
Response headers are showing cloudflare headers
In my worker I am fetching an external API, and ultimately need to read the headers from the response. The problem is that it keeps showing me request headers instead of the response headers.
2 replies
CDCloudflare Developers
•Created by Lu on 6/28/2023 in #general-help
Clearing workers cache?
Is there a way to purge the entire cache for a worker from the CF dashboard itself? Or whats a good way to purge.
2 replies
TTCTheo's Typesafe Cult
•Created by Lu on 6/2/2023 in #questions
How to redirect with new headers back to the same page?
User goes to page
/foo
, we check if this page is protected, if it is, we rewrite the page to something else using middleware, now this identical page has a password form.
The goal is to authenticate the password, and if its correct, redirect them back to the original page with headers pretty much allowing the user to skip the rewrite in the middleware and view the protected page.
Is this possible?2 replies