Repository navigation
Test that a session cookie found only in the web request tells usage sharing's sessions apart - #145
Merged
Merged
Conversation
…sharing's sessions apart
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.
Problem
With session tracking on, usage sharing compares a request with those already shared using the values it would share and the session cookie (
pipeline/fiftyone.pipeline.engines.fiftyone/shareUsage.jslines 263 to 276 at 0e89a400). Those values come from the Evidence and from the web request supplied asserver.http-request(lines 289 to 313), as the specification asks. The only test of session tracking, inshareUsage.test.js, gives the session cookie as Evidence, so nothing showed that a cookie found only in the web request is read too.What the specification says
From
pipeline-specification/pipeline-elements/usage-sharing-element.mdlines 90 to 99 at b6fae7fe, the text specifications#155 merged:What changed
Tests only, so no package is released for this.
Tests
The new
pipeline/fiftyone.pipeline.engines.fiftyone/tests/shareUsageSessionFromRequest.test.jsbuilds a Pipeline with usage sharing tracking sessions by the cookiesessionid, and processes three requests whose user agent is in the Evidence and whose session cookie is only inserver.http-request, two in one session and one in another. The package size is larger than the number of requests, so nothing is sent and the queue shows what was shared. It checks that two records are queued, the repeat in the first session being left out and the same request in the new session shared, and that no record holds the cookie's value.Run 43678509790 on fe491af, this head, with only a throwaway workflow added that runs the usage sharing package's tests. All 99 pass on Ubuntu and on Windows, lint passes on the package, and
npm run tscwrites the committed types again with no difference butpipeline/fiftyone.pipeline.did/types/owid-js/v1.d.ts, which #127 decides.The test passes on
rc's code, so to show it fails when the web request is not read, run 43678515060 ran it on a throwaway branch wheregetFoundEvidenceignoresserver.http-request. On Ubuntu and on Windows 3 of 99 fail, being this test, where only 1 record was queued, and two existing tests of values found only in the web request.Full build
Run 43679480793 on
tmp/pr-matrix-145, started bytools/pr-matrix.pywithout macOS. All 7Setting 'PullRequestSha'lines give this head, fe491af, and Configure printed "Left out 2 macOS entries". Each of the six Build and Test jobs, Ubuntu, Ubuntu ARM and Windows on Node.js 22 and 24, passed 1,604 unit tests with 2 skipped and 119 integration tests with 4 skipped.macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.
What remains
Nothing for this requirement.