This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/unit
Krzysztof Kotlarek 9610aea189
FEATURE: cache last post number (#15772)
Instead of relaying on /timings request, we should cache last read post number. That should protect from having incorrect unread counter when going back to topic list.

This additional cache is very temporary as once /timings request is finished, serializer will have a correct result.

Simplified flow is:
1. Store in cache information about last seen post number before /timings request is sent
2. When getting back to topic list compare value of last seen post number returned by /latest request and information in cache. If cache number is higher, than use it instead of information returned by /latest. In addition delete cache item as there is high chance that `/timings` request already finished.
3. Optionally, delete cache when timings request is done and topic list was not yet visited.

Keeping cache reasonably small should not affect performance.
2022-02-10 13:09:28 +11:00
..
controllers DEV: Deprecate assert.not() (#15595) 2022-02-09 18:49:05 +01:00
ember DEV: Replace equal() with strictEqual() (#14827) 2021-11-08 10:26:28 +01:00
lib DEV: Deprecate assert.not() (#15595) 2022-02-09 18:49:05 +01:00
mixins DEV: Deprecate assert.not() (#15595) 2022-02-09 18:49:05 +01:00
models FIX: topic tracking state for tags (#15623) 2022-02-09 22:53:08 +01:00
services FEATURE: cache last post number (#15772) 2022-02-10 13:09:28 +11:00
utils DEV: drops jquery from scrolling-post-stream (#15313) 2021-12-17 14:52:42 +01:00
localization-test.js FIX: Translation overrides from fallback locale didn't work on client 2021-12-17 14:03:35 +01:00