PROD-2346: write local container cache on create/update/adopt#196
Merged
Conversation
container-pusher.ts wrote the mapping row after a successful create,
update, or PROD-2307 referenceName-adopt, but never the local
containers/{id}.json cache file that ContainerMapper.getMappedEntity
reads from disk. That left a same-run gap: a container created and
then pushed content into in the same sync would have its content
rejected with the PROD-2309 "container no longer exists" guard, since
the guard can't tell "just created, not cached yet" apart from
"genuinely deleted since last sync".
jules-exel
approved these changes
Jul 24, 2026
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
container-pusher.tswrote the source→target mapping row after a successful container create, update, or PROD-2307 referenceName-adopt, but never wrote the corresponding localcontainers/{id}.jsondisk cache thatContainerMapper.getMappedEntityreads from.cacheTargetContainer(targetGuid, container)helper (mirrorsdownload-containers.ts's cache-write shape) and call it after all three success paths: create, update, and the PROD-2307 adopt-by-referenceName branch, which has the identical gap.saveContainer()returns the fullContainertype (same shape asgetContainerByID()), so the create/update response itself is sufficient to write the cache — no extra API round-trip needed.Test plan
container-pusher.test.tsasserting the cache file is written to disk after create, update, and adopt-by-referenceNamesrc/lib/pushers+src/lib/mapperssuite passes (21 suites, 421 tests)🤖 Generated with Claude Code