mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Creating a table publication(s) (and associated replication slot) is sticky. These will outlive the lifetime of the process that created them. We don't want to remove them on shutdown, because this will pause WAL writing to disk. However, when starting the _new_ application, it's possible `table_subscriptions` has changed (such as if we decide we no longer want events for a certain table). We weren't updating the created publication(s) with these added/removed tables, so this PR updates the replication connection setup state machine to pass through a few conditionals to get these properly updated with the diff of old vs new.