@whotracksme/reporting 12.1.9 β†’ 12.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v12.1.10 (Wed Nov 18 2026)
2
+
3
+ #### πŸ› Bug Fix
4
+
5
+ - fix: PageDB does not update pages in tabs that are not active [#252](https://github.com/whotracksme/webextension-packages/pull/252) ([@philipp-classen](https://github.com/philipp-classen))
6
+
7
+ #### Authors: 1
8
+
9
+ - Philipp Claßen ([@philipp-classen](https://github.com/philipp-classen))
10
+
11
+ ---
12
+
1
13
  # v12.1.9 (Wed Nov 18 2026)
2
14
 
3
15
  #### πŸ› Bug Fix
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whotracksme/reporting",
3
- "version": "12.1.9",
3
+ "version": "12.1.10",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./sanitizer": "./reporting/src/sanitizer.js",
@@ -263,7 +263,7 @@ export default class PageDB {
263
263
  const shouldUpdate =
264
264
  url == activeUrl ||
265
265
  (inMemoryEntry !== null &&
266
- pages.some((x) => x.lastUpdatedAt) > inMemoryEntry.lastUpdatedAt);
266
+ pages.some((x) => x.lastUpdatedAt > inMemoryEntry.lastUpdatedAt));
267
267
  if (shouldUpdate) {
268
268
  const updateDB = (oldEntry) => {
269
269
  const page = mergePages([oldEntry, ...pages]);
@@ -172,6 +172,49 @@ describe('#PageDB', function () {
172
172
  await expectUrlsInMemory([page.url]);
173
173
  await expectUrlsInDb([page.url]);
174
174
  });
175
+
176
+ describe('for a page in a non-active tab that is already known', function () {
177
+ function loadingPage() {
178
+ const page = { ...somePage(), status: 'loading' };
179
+ delete page.preDoublefetch;
180
+ return page;
181
+ }
182
+
183
+ async function pageInMemory(url) {
184
+ const { memory } = await uut.describeState({ inMemoryOnly: true });
185
+ return memory[url];
186
+ }
187
+
188
+ it('should take over newer information', async function () {
189
+ const before = loadingPage();
190
+ await uut.updatePages([before], undefined);
191
+
192
+ const after = {
193
+ ...somePage(),
194
+ lastUpdatedAt: before.lastUpdatedAt + 1,
195
+ };
196
+ await uut.updatePages([after], undefined);
197
+
198
+ const page = await pageInMemory(after.url);
199
+ expect(page.status).to.eql('complete');
200
+ expect(page.preDoublefetch).to.eql(after.preDoublefetch);
201
+ });
202
+
203
+ it('should ignore older information', async function () {
204
+ const before = somePage();
205
+ await uut.updatePages([before], undefined);
206
+
207
+ const after = {
208
+ ...loadingPage(),
209
+ lastUpdatedAt: before.lastUpdatedAt - 1,
210
+ };
211
+ await uut.updatePages([after], undefined);
212
+
213
+ const page = await pageInMemory(before.url);
214
+ expect(page.status).to.eql('complete');
215
+ expect(page.preDoublefetch).to.eql(before.preDoublefetch);
216
+ });
217
+ });
175
218
  });
176
219
 
177
220
  describe('#acquireExpiredPages', function () {