Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an attempt to drastically reduce our firebase storage. Checkpoints are static and only loaded at page-load, there is no need for them to be storaged in firebase. Furthermore, we are storing checkpoints and changes for pubs that are essentially done in perpetuity in firebase. If we instead 'cold store' checkpoints in postgres, we can remove a large majority of content from firebase, reducing our costs.
Adds a
DraftCheckpointstable in Postgres as the single source of truth for draft checkpoints, replacing Firebase'scheckpoints/nodes. The server now loads checkpoints from Postgres first and layers any new Firebase changes on top, falling through to the original Firebase-only path when no PG checkpoint exists. The client writes new checkpoints to Postgres viaPOST /api/draftCheckpointinstead of Firebase. This is a zero-downtime change: beforebootstrapCheckpointsruns, every draft load silently falls back to Firebase.A new
coldStoragetool freezes inactive drafts (default 30+ days) by storing their full state in Postgres—including discussions and cumulative stepMaps for release discussion-anchor mapping—then wiping their Firebase path entirely. The existingcleanupFirebasecron is updated to use PG checkpoints as the prune threshold (capturing stepMaps before deleting Firebase changes). Cold storage runs weekly on Saturday, cleanup on Sunday. Deployment order: deploy → run migration (2026_04_02_addColdCheckpointIdToDrafts) → runbootstrapCheckpoints --execute→ let crons run. All scripts are idempotent and safe to re-run.No impact on user experience - all 'coldStored' drafts load just as they would previously. Performance likely will improve since we're pulling checkpoint data from on-machine pg rather than firebase.