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/app/services
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
..
app-events.js DEV: Drop support for removing all appEvent listeners (#14936) 2021-11-15 12:31:05 +01:00
document-title.js FIX: Hide notification count on document title in Do Not Disturb (#11646) 2021-01-06 16:15:04 -06:00
emoji-store.js DEV: correctly notify property changes of emoji store (#15389) 2021-12-22 10:59:41 +01:00
logs-notice.js DEV: Refactor logs-notice/global-notice (#15000) 2021-11-18 21:49:58 +01:00
media-optimization-worker.js DEV: Handle CORS and other fetch failures for media-optimization-worker (#15364) 2021-12-21 09:00:19 +10:00
presence.js DEV: Allow PresenceChannel to specify custom activity thresholds (#15217) 2021-12-07 20:57:57 +00:00
screen-track.js FEATURE: cache last post number (#15772) 2022-02-10 13:09:28 +11:00
search.js DEV: Make search an actual service (#14998) 2021-11-18 16:52:03 +01:00
store.js DEV: Make store an actual service (#14996) 2021-11-18 16:51:20 +01:00