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/helpers
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
..
component-test.js DEV: Avoid using globals (#14909) 2021-11-13 13:10:13 +01:00
create-pretender.js DEV: Update fixture to fix tests (#15699) 2022-01-25 00:44:14 +03:00
create-store.js DEV: Refactor Site creation in tests (#15707) 2022-02-03 10:02:47 +00:00
d-editor-helper.js REFACTOR: Move javascript tests inside discourse app 2020-10-02 11:29:36 -04:00
fixture-pretender.js Support for Testem in Ember CLI (#12442) 2021-03-19 09:32:46 -04:00
presence-pretender.js DEV: prevents Firefox ESR tests to crash on ||= (#14758) 2021-10-28 10:55:22 +02:00
qunit-helpers.js FEATURE: cache last post number (#15772) 2022-02-10 13:09:28 +11:00
review-pretender.js FEATURE: reason to reject user signup (#11700) 2021-01-15 09:43:26 +11:00
select-kit-helper.js DEV: Remove jQuery global usage where possible (#14905) 2021-11-12 19:23:20 +01:00
site-settings.js FEATURE: Make allow_uploaded_avatars accept TL (#14091) 2021-08-24 10:46:28 +03:00
site.js DEV: Remove hints of jshint (#14828) 2021-11-08 09:12:37 +08:00
store-pretender.js REFACTOR: Move javascript tests inside discourse app 2020-10-02 11:29:36 -04:00
textarea-selection-helper.js REFACTOR: Move javascript tests inside discourse app 2020-10-02 11:29:36 -04:00
widget-test.js FIX: Lots of plugin tests were using old, non-Ember compat CLI APIs (#13320) 2021-06-09 10:58:55 -04:00