Repository navigation
fix(search): poll a snapshot's operation only at the path built from its id - #124
Merged
Merged
Conversation
…its id captureSnapshot followed the poll paths the Datasets API returned, on the server. It now checks the operation id against OPERATION_SHAPE and polls /api/datasets/operations/<id> on every round, through operationPath in operationPoll.ts, which shareDownload.ts and PreparingDownload.tsx share. Refs #79
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.
captureSnapshotinsrc/lib/search/snapshot.tspolled the paths the Datasets API returned, on the server, without checking them. It now refuses an operation id that failsOPERATION_SHAPEbefore any poll, and polls/api/datasets/operations/<id>on every round, ignoring each response'spoll.OPERATION_SHAPEand the newoperationPathlive inoperationPoll.ts, andshareDownload.tsandPreparingDownload.tsxuse them in place of their own copies.forwardablePathwas the wrong check here, because it checks segments and passes paths such as/api/graph/x.The snapshot banner needs no code change. A search snapshot is stored seconds after its mint, so its
createdAtis the right "data as of", and a switched canvas share dates each card from its serving history. The one gap left is a Studio share made directly as a snapshot, whose saved frame can be older than the share, and no field in dfo-apis' share answers dates a frame. That goes to an issue in dfo-apis. The corpus copy fix is in DevelopmentFinanceObservatory/docs and lands here as a re-sync layer at the top of this stack.Refs #79
Testing:
pnpm lint,pnpm typecheck,pnpm test(2287 pass),pnpm build. The new snapshot tests feed hostile poll paths (another surface, a..segment, an absolute URL) and malformed ids, and assert the exact URLs fetched; they fail on the old code.