fix(worker): dedupe artifact boot replay, incremental route trie - #203
Merged
07prajwal2000 merged 2 commits intoAug 5, 2026
Merged
Conversation
Left over from the pre-fix double-load path (Fluxify-rest#191); watchArtifacts with includeExisting now covers the initial snapshot, so nothing calls it.
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.
Summary
watchArtifacts/watchProjectArtifactsnow use a single NATS KV watch (includeExistingtogglesLastValuevsUpdatesOnly) instead of a separateloadProjectArtifacts()snapshot read followed by a watch — no more double replay of the initial state.compiledWorker.tsawaits the watch's initial replay before spawning the execution process, so it boots with a deduped snapshot exactly once.HttpRouteParsergainedupsertRoute/removeRoutefor incremental trie insert/prune;compiledRuntime.tsuses these per-artifact instead ofrebuildRoutes()on every update.listArtifacts()(natsKv.ts) — dead code left over from the old snapshot-read path, no remaining callers.Test plan
bun test packages/lib/tests/parser.spec.ts— 4/4 pass, covers upsert/remove without disturbing unrelated routesbun run --cwd apps/server lint(tsgo --noEmit) — clean/api/users+/api/users/:id) and shared-method branches — correct, only prunes branches left with no childrenKvWatchInclude.UpdatesOnly/LastValueagainst the installednatspackage's type defs🤖 Generated with Claude Code