Skip to content

Fix export decoding after dataset parameter mutation - #129

Open
Abdelhamid-9v wants to merge 2 commits into
prooflinedev:mainfrom
abdelhamid-dev-lab:fix/export-dataset-snapshot
Open

Abdelhamid-9v wants to merge 2 commits into
prooflinedev:mainfrom
abdelhamid-dev-lab:fix/export-dataset-snapshot

Conversation

@Abdelhamid-9v

Copy link
Copy Markdown

When a caller reuses export parameters while a response is pending, exportReviews() can validate the response against a different dataset from the one requested. For example, changing parameters.path.dataset from findings to reviews causes a valid findings version 2 response to be rejected using the reviews version rules.

Capture the dataset at call time and use that value in the response decoder, as already done for the format. Add an HTTP-backed regression test that starts a findings export, changes the caller's dataset before awaiting the response, and verifies the original request path, accepted version, and returned row.

Verification

  • Regression test fails with the original decoding behavior and passes with the dataset capture; that focused red/green check used in-memory TypeScript transformation.
  • After merging the fork's current main, the normal build and full test suite pass: 110 tests, 0 failures.
  • Frozen dependency installation, generation with no working-tree diff, build, typecheck, lint, node check-claims.mjs, and git diff --check pass.
  • The contribution relative to main changes only src/index.ts and tests/http.test.mjs.

Reproduce locally:

pnpm install --frozen-lockfile
pnpm generate
git diff --exit-code
pnpm build
node --test --test-name-pattern="export decoding keeps the originally requested dataset" tests/http.test.mjs
pnpm test
pnpm typecheck
pnpm lint
node check-claims.mjs
git diff --check

The regression uses a local HTTP server and fixture credentials.

Proofline review assessment

In my fork's PR #1, Proofline review, run 1 reviewed commit 93fea01 and reported no findings. The review covered the pull request code; the environment was not checked.

There were no findings to accept or reject, so I made no code changes in response to this review. I kept the regression test and the 110 passing local tests as independent evidence for the fix. A no-findings result does not establish that every possible bug is absent.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant