Fix that proofreading got stuck with expired token #7598
Merged
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.
The bucketProvider was cached using only the layer name. For EditableMappingLayers, the token is stored in the layer. That meant that even when a new request uses a new token, the old token is still used by the cached bucketProvider. When that token expires, the BucketProvider fails permanently with the old token.
This PR includes the token in the bucketProviderCacheKey similar to the mechanism in https://github.com/scalableminds/webknossos/pull/7437/files#diff-0a1de65bd00003637bef68955997c0de7a92d0402bda79f32fda5dde4e5a5816
Steps to test:
silhouettetokenAuthenticator.dataStoreExpiry = 10 seconds
in application.conf. With this, the frontend will request a new token and use that after the old one is expired. It is then also passed to the bucketProvider. The bug occurred quickly with that config but the old code.Issues: