Day 81 · 19 November 2026
Chapter 3 · 31 days to the chapter deadline
- Previews - Safety Nets and Separation
Spent today reworking the previews. What a long (but equally rewarding) day.
Since implementing Workers for Platforms as a way to segment tenants I've had to do a lot of refactoring and general architectural changes.
The preview system I integrated into the management platform starting showing it's limitations...I had set it up so that the Postie tenant became the de facto staging tenant and between the connectors and shared app shell this meant that previews generated to be tested in Postie couldn't then be tested properly because app changes couldn't be tested before the whole app shell was deployed... not ideal.
App Shell Deploying After The Staging Check Made Previews PointlessSo I added feature flags to test things in production but gated to certain accounts. It worked for relatively small features (and is good for the future production implementation) but then came the realities of migrations and how i would effectively need to refactor the code again to better utilise space and limit spend in order not to get completely murdered by one large migration. As a base one of my clients has 500GB between 5 employees and 5 shared inboxes which would need to be transferred over... (not that I am actually going to do that, just a guide) and the way i've currently set up the D1 implementation is making this completely out of capacity. Hard limits of 10GB per DB is less than ideal.
Worth mentioning I'm not storing the messages in D1 but just the search indexes. So with these realities I've sort to better organise database provisions for search vs mail storage. However, because Postie itself is in an actual working state I don't want to just start ripping things out and start remoddelling. So... complete staging separation and previews that actually work, with their own tenants, their own feature flags and their own auth and everything....
It was a hard fought battle with a few scrapes and scratches along the way but I'm happy to now say that now I can test things in complete isolation and test things, implement flags, test db changes and rollback if needed. Now I can continue to move forward knowing that I can test things (and fuck up) without impacting production. Having a safety net and separation is a wonderful thing.
