add option to configure when shoebox data expires #369
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.
In certain cases, like the browser restoring its session, a cached version of the index.html page may be served by the browser, which contains shoebox data from the initial, cached request. The adapter is not aware that this data is stale, and outdated information is displayed to the user (without ever making a request to the backend). To prevent that, this PR adds a param to configure after which duration data no longer is served from the shoebox.
If this value is not present in
config/environment.js
, current behaviour is maintained: the shoebox does never expire.The current date when the adapter is initialised is stored in the shoebox and is compared when rendered in the browser. This should be fine, unless the fastboot server is optimised to not tear down the adapter across different requests.
I also removed the
ember-cli-htmlbars-inline-precompile
dependency, as it is no longer needed:DEPRECATION: ember-cli-htmlbars-inline-precompile is no longer needed with ember-cli-htmlbars versions 4.0.0 and higher, please remove it from `package.json
I tried to add some tests, but could not find a way to mock the config with the current test setup. If someone can provide a hint how to make that work, I'll give it another try.