Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(mobile): reduce shell cache encoding work #15096

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/15096/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 140 additions and 27 deletions.

x
0 of 2 viewed, 2 left
93 additions and 4 deletionsapps/mobile/src/connection/environment-cache-store.test.tsModified
View file
@@ -388,16 +388,105 @@
}),
​
- it.effect("still rejects invalid rows after an encoding batch yields", () =>
+ it.effect("preserves optional fields and dates across chunk boundaries and archived rows", () =>
Effect.gen(function* () {
- const invalid = {
+ const base = SHELL_SNAPSHOT.threads[0]!;
+ const { titleRegeneration: _, unsettledAt: __, ...withoutOptional } = base;
+ const row = (index: number) =>
+ index % 3 === 0
+ ? { ...withoutOptional, id: ThreadId.make(`row-${index}`) }
+ : {
+ ...base,
+ id: ThreadId.make(`row-${index}`),
+ snoozedUntil: DateTime.add(NOW, { minutes: index }),
+ pinnedAt: index % 2 === 0 ? null : NOW,
+ };
+ const mixed = {
...stored,
snapshot: {
...stored.snapshot,
- threads: [...stored.snapshot.threads, { ...stored.snapshot.threads[0]!, itemCount: -1 }],
+ threads: Array.from({ length: 65 }, (_, index) => row(index)),
+ archivedThreads: Array.from({ length: 33 }, (_, index) => ({
+ ...row(index + 100),
+ archivedAt: DateTime.add(NOW, { hours: index }),
+ })),