{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":21242339,"defaultBranch":"main","name":"govuk-prototype-kit","ownerLogin":"alphagov","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2014-06-26T13:54:09.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/596977?v=4","public":true,"private":false,"isOrgOwned":true},"refInfo":{"name":"","listCacheKey":"v0:1712239407.0","currentOid":""},"activityList":{"items":[{"before":"9dac9220fb9a89440d14cf203aeab4eba0a5b80e","after":null,"ref":"refs/heads/release-13.16.2","pushedAt":"2024-04-04T14:03:20.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"}},{"before":"3d8e7fce86d2f62a646ea514ff8fdf4b8c1abfea","after":"c0e707982e3e08dc5b43b7467196145fb96a29ba","ref":"refs/heads/main","pushedAt":"2024-04-04T14:03:19.000Z","pushType":"pr_merge","commitsCount":3,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Merge pull request #2407 from alphagov/release-13.16.2\n\nPreparing for release 13.16.2 (automated).","shortMessageHtmlLink":"Merge pull request #2407 from alphagov/release-13.16.2"}},{"before":null,"after":"9dac9220fb9a89440d14cf203aeab4eba0a5b80e","ref":"refs/heads/release-13.16.2","pushedAt":"2024-04-04T13:40:13.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Updated changelog automatically.","shortMessageHtmlLink":"Updated changelog automatically."}},{"before":"7060f239e496b977beb1edba3ec0d3fa5f1b0416","after":"3d8e7fce86d2f62a646ea514ff8fdf4b8c1abfea","ref":"refs/heads/main","pushedAt":"2024-04-03T15:15:53.000Z","pushType":"pr_merge","commitsCount":3,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Merge pull request #2404 from joelanman/main\n\nFix issues creating prototypes when using npm v10.4.0 or newer by removing dependency on zlib","shortMessageHtmlLink":"Merge pull request #2404 from joelanman/main"}},{"before":"5e534e78b1b71c666f3da66a71b55c47039333f2","after":null,"ref":"refs/heads/jsdoc","pushedAt":"2024-03-08T10:46:20.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"}},{"before":"bb9528b488e662cd5b6a529e761b9c3714263348","after":"7060f239e496b977beb1edba3ec0d3fa5f1b0416","ref":"refs/heads/main","pushedAt":"2024-03-08T10:46:19.000Z","pushType":"pr_merge","commitsCount":8,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"},"commit":{"message":"Merge pull request #2386 from alphagov/jsdoc\n\nAdd JSDoc to document plugin configs etc","shortMessageHtmlLink":"Merge pull request #2386 from alphagov/jsdoc"}},{"before":"a9178ded6a0a233a2a304ea3621a762a303cab94","after":"4f7a09cf80b75c7ec410c2cacf2669d9527aad6a","ref":"refs/heads/jsdoc-checks","pushedAt":"2024-03-05T15:39:43.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"},"commit":{"message":"Enable JavaScript compiler checks","shortMessageHtmlLink":"Enable JavaScript compiler checks"}},{"before":"11517436d5d44521cce1758d44b2842cf5e21082","after":"5e534e78b1b71c666f3da66a71b55c47039333f2","ref":"refs/heads/jsdoc","pushedAt":"2024-03-05T15:39:17.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"},"commit":{"message":"Fix to validate `nunjucksPaths` as a string","shortMessageHtmlLink":"Fix to validate nunjucksPaths as a string"}},{"before":"24534b19d66f0faada09fbedff8357a6f843d152","after":"11517436d5d44521cce1758d44b2842cf5e21082","ref":"refs/heads/jsdoc","pushedAt":"2024-03-05T15:38:46.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"},"commit":{"message":"Fix to validate `nunjucksPaths` as a string","shortMessageHtmlLink":"Fix to validate nunjucksPaths as a string"}},{"before":"ea915a5b6e401aa6e59aee6e292e25dcf67ae579","after":null,"ref":"refs/heads/release-13.16.1","pushedAt":"2024-03-04T17:14:21.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"}},{"before":"74941c29faa056db35ea1408dde60f45ad833930","after":"bb9528b488e662cd5b6a529e761b9c3714263348","ref":"refs/heads/main","pushedAt":"2024-03-04T17:14:20.000Z","pushType":"pr_merge","commitsCount":3,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Merge pull request #2402 from alphagov/release-13.16.1\n\nPreparing for release 13.16.1 (automated).","shortMessageHtmlLink":"Merge pull request #2402 from alphagov/release-13.16.1"}},{"before":null,"after":"ea915a5b6e401aa6e59aee6e292e25dcf67ae579","ref":"refs/heads/release-13.16.1","pushedAt":"2024-03-04T16:57:09.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Updated changelog automatically.","shortMessageHtmlLink":"Updated changelog automatically."}},{"before":"653d635ad2c4ca54907771c3ab6d39cc2450672a","after":null,"ref":"refs/heads/plugin-search-input","pushedAt":"2024-03-04T09:51:10.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"}},{"before":"bfb9c8e960a45189401774121ba3089389504284","after":"74941c29faa056db35ea1408dde60f45ad833930","ref":"refs/heads/main","pushedAt":"2024-03-04T09:51:09.000Z","pushType":"pr_merge","commitsCount":3,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Merge pull request #2398 from alphagov/plugin-search-input\n\nAssociate the plugin search input with its label","shortMessageHtmlLink":"Merge pull request #2398 from alphagov/plugin-search-input"}},{"before":"ff5a55d6842742172b71190767ce9cf1de6c7e30","after":"653d635ad2c4ca54907771c3ab6d39cc2450672a","ref":"refs/heads/plugin-search-input","pushedAt":"2024-02-28T16:44:26.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Document in CHANGELOG","shortMessageHtmlLink":"Document in CHANGELOG"}},{"before":"e6eec537c3f3970524dd2c8cc2116a8876d5b50d","after":"bfb9c8e960a45189401774121ba3089389504284","ref":"refs/heads/main","pushedAt":"2024-02-28T16:43:14.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Merge pull request #2401 from alphagov/2399-changelog\n\nAdd changelog entry for #2399","shortMessageHtmlLink":"Merge pull request #2401 from alphagov/2399-changelog"}},{"before":"8d16b9e34e5ae2736c372fb461dabd7e0d30b968","after":null,"ref":"refs/heads/2399-changelog","pushedAt":"2024-02-28T16:43:14.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"}},{"before":"77b794393a21b7616067ccb7da6646da3c70496a","after":null,"ref":"refs/heads/bug-fixes","pushedAt":"2024-02-28T15:55:32.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"}},{"before":"75f9623ce5c80fede09c214a5298d2875e02916b","after":"e6eec537c3f3970524dd2c8cc2116a8876d5b50d","ref":"refs/heads/main","pushedAt":"2024-02-28T15:55:31.000Z","pushType":"pr_merge","commitsCount":5,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"},"commit":{"message":"Merge pull request #2385 from alphagov/bug-fixes\n\nVarious bug fixes and code issues","shortMessageHtmlLink":"Merge pull request #2385 from alphagov/bug-fixes"}},{"before":"459b60720f84e90fa8adb28141f758043db78dc4","after":"77b794393a21b7616067ccb7da6646da3c70496a","ref":"refs/heads/bug-fixes","pushedAt":"2024-02-28T10:49:13.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"},"commit":{"message":"Fix plugin config checks letting arrays through","shortMessageHtmlLink":"Fix plugin config checks letting arrays through"}},{"before":"6fecb7827c3bdc329bb0302a53fcf26909d89b14","after":"a9178ded6a0a233a2a304ea3621a762a303cab94","ref":"refs/heads/jsdoc-checks","pushedAt":"2024-02-28T10:46:03.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"},"commit":{"message":"Enable JavaScript compiler checks","shortMessageHtmlLink":"Enable JavaScript compiler checks"}},{"before":"65ffc16afd95bdd371ffba330819007695d8b8c8","after":"24534b19d66f0faada09fbedff8357a6f843d152","ref":"refs/heads/jsdoc","pushedAt":"2024-02-28T10:45:44.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"},"commit":{"message":"Fix JSDoc `@param` in `mkPrototype()`","shortMessageHtmlLink":"Fix JSDoc @param in mkPrototype()"}},{"before":null,"after":"8d16b9e34e5ae2736c372fb461dabd7e0d30b968","ref":"refs/heads/2399-changelog","pushedAt":"2024-02-28T10:30:34.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Add changelog entry for #2399","shortMessageHtmlLink":"Add changelog entry for #2399"}},{"before":"66b4cfe1efa95191cc7ab3ba88221cfba371e47f","after":null,"ref":"refs/heads/fix-non-expired-session-cleanup","pushedAt":"2024-02-28T09:48:11.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"}},{"before":"dcf44299773a72479734ff5dc161c35889f90aca","after":"75f9623ce5c80fede09c214a5298d2875e02916b","ref":"refs/heads/main","pushedAt":"2024-02-28T09:48:10.000Z","pushType":"pr_merge","commitsCount":2,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Merge pull request #2399 from alphagov/fix-non-expired-session-cleanup\n\nStop accidentally cleaning up non-expired sessions","shortMessageHtmlLink":"Merge pull request #2399 from alphagov/fix-non-expired-session-cleanup"}},{"before":null,"after":"66b4cfe1efa95191cc7ab3ba88221cfba371e47f","ref":"refs/heads/fix-non-expired-session-cleanup","pushedAt":"2024-02-27T17:48:35.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Stop accidentally cleaning up non-expired sessions\n\nWe store session data in the filesystem using our own session `FileStore` class. Each session is stored as a separate JSON file inside `.tmp/sessions` with an expiry date and the data for session.\n\nAs part of the `set` method for the FileStore class, we have some logic which tries to clean up expired sessions from the filesystem.\n\nThis loops through all of the files in the session store directory and checks each one in turn to see if the expiry date in the JSON is in the past. If it is, it calls `this.destroy` passing the `storedSessionId`. This happens asynchronously – we map over the files in the directory to create an array of promises, each of which awaits a call to the filesystem to read the JSON.\n\nUnfortunately, `storedSessionId` is scoped to the outer `set` method and is therefore affected by the other promises that are running concurrently.\n\nBecause of this, when there are expired sessions in the session store, it’s possible for non-expired sessions to be destroyed instead, depending on the value of `storedSessionId` at the time destroy is called.\n\nFurthermore, because this leaves the expired session in place, further attempts to set data are likely to continue cleaning up the non-expired sessions.\n\nYou can observe this (and verify that this fixes the issue) by:\n\n1. Adding logging just before the call to this.destroy on line 23:\n\n ```\n console.log(`Destroying expired session ${storedSessionId}`)\n ```\n\n2. Clearing all session data by deleting `.tmp/session`\n3. Generating multiple non-expired sessions by refreshing the Prototype Kit multiple times [^1]\n4. Manually updating the expiry date in the JSON for one of the sessions to be in the past [^2]\n5. Refreshing the kit and observing that a session with a different ID is destroyed\n\nFix this by correctly scoping the `storedSessionId` variable to the asynchronous function, preventing it being altered by other promises resolving at the same time.\n\nDue to the limited support we are currently able to provide for the kit, I have made the smallest possible change I believe fixes the bug and not done any further refactoring.\n\nAlso, whilst I believe it would be beneficial to have tests that cover this code (including this specific bug) I have not done this as it’s non-trivial and involves mocking the file system.\n\nCloses #2393.\n\n[1]: This works because the request for the new manifest added in GOV.UK Frontend v5.0 (served at `/plugin-assets/govuk-frontend/dist/govuk/assets/manifest.json` in the kit) is made without credentials (see the note on https://web.dev/articles/add-manifest) which results in an extra session being created (and never reused) every time the page is loaded. I think this also might have made this bug more likely to occur because of the sheer number of session files that get created.\n\n[2]: In case it’s useful for testing, this jq command shows the expiry date for all current sessions:\n\n ```\n jq -r -n 'inputs | \"\\(input_filename) \\(.cookie.expires)\"' .tmp/sessions/*.json | sort | head\n ```\n\nCo-authored-by: Colin Rotherham ","shortMessageHtmlLink":"Stop accidentally cleaning up non-expired sessions"}},{"before":"80f0459ede7f012cf23c00eb1d4a7812f56fbf3e","after":"ff5a55d6842742172b71190767ce9cf1de6c7e30","ref":"refs/heads/plugin-search-input","pushedAt":"2024-02-26T10:14:32.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Document in CHANGELOG","shortMessageHtmlLink":"Document in CHANGELOG"}},{"before":null,"after":"80f0459ede7f012cf23c00eb1d4a7812f56fbf3e","ref":"refs/heads/plugin-search-input","pushedAt":"2024-02-26T10:12:15.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"36degrees","name":"Oliver Byford","path":"/36degrees","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/121939?s=80&v=4"},"commit":{"message":"Associate plugin search input and label\n\nThe search input on the plugin list page does not have a programatically label because the label is not currently associated with the input.\n\nRather than using the separate `govukLabel` macro, pass the label options to the `govukInput` macro and let it take care of associating the label for us.\n\nWe can also use the `govuk-label--s` modifier rather than a font weight override.","shortMessageHtmlLink":"Associate plugin search input and label"}},{"before":"d8741146aca8f3bd7cd28996d9bfea6d8bb98b17","after":null,"ref":"refs/heads/package-updates","pushedAt":"2024-02-22T12:06:49.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"}},{"before":"e2640d9af67a066abae5cc25c1989d09e3df52fb","after":"dcf44299773a72479734ff5dc161c35889f90aca","ref":"refs/heads/main","pushedAt":"2024-02-22T12:06:48.000Z","pushType":"pr_merge","commitsCount":4,"pusher":{"login":"colinrotherham","name":"Colin Rotherham","path":"/colinrotherham","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/415517?s=80&v=4"},"commit":{"message":"Merge pull request #2394 from alphagov/package-updates","shortMessageHtmlLink":"Merge pull request #2394 from alphagov/package-updates"}}],"hasNextPage":true,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAEJ95CXQA","startCursor":null,"endCursor":null}},"title":"Activity · alphagov/govuk-prototype-kit"}