Skip to content

Commit 58b4630

Browse files
committed
Remove old references to last row read stored outside events
1 parent c514f17 commit 58b4630

File tree

3 files changed

+0
-15
lines changed

3 files changed

+0
-15
lines changed

src/init-dependencies/google/cache-sheet-data.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const cacheSheetData =
2222
VALUES (?, ?, ?)
2323
ON CONFLICT (sheet_id) DO UPDATE SET
2424
cached_at = excluded.cached_at,
25-
last_row_read = excluded.last_row_read,
2625
cached_data = excluded.cached_data;
2726
`,
2827
[cacheTimestamp, sheetId, cachedData]

src/init-dependencies/google/cached-data-table.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export const CachedDataTable = t.strict({
66
t.strict({
77
cached_at: tt.DateFromNumber,
88
sheet_id: t.string,
9-
last_row_read: tt.withFallback(t.string, '{}'),
109
cached_data: t.string,
1110
})
1211
),

src/init-dependencies/google/get-cached-sheet-data.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
} from '../../types/failure-with-status';
1919
import {StatusCodes} from 'http-status-codes';
2020
import {dbExecute} from '../../util';
21-
import {LastGoogleSheetRowRead} from '../../read-models/shared-state/return-types';
2221

2322
// Note that this isn't automatically type safe. It does rely on the cached
2423
// data actually being the type of DomainEvent we say it is.
@@ -33,16 +32,6 @@ const extractCachedEvents = <R>(
3332
E.map(elements => elements as ReadonlyArray<R>)
3433
);
3534

36-
const extractLastRowRead = (
37-
rawLastRowReadData: string
38-
): t.Validation<LastGoogleSheetRowRead> =>
39-
pipe(
40-
rawLastRowReadData,
41-
tt.JsonFromString.decode,
42-
E.chain(tt.JsonRecord.decode),
43-
E.chain(t.record(t.string, t.record(t.string, t.number)).decode)
44-
);
45-
4635
export const getCachedSheetData =
4736
<R>(dbClient: Client) =>
4837
(
@@ -51,7 +40,6 @@ export const getCachedSheetData =
5140
FailureWithStatus,
5241
O.Option<{
5342
cached_at: Date;
54-
last_row_read: t.Validation<LastGoogleSheetRowRead>;
5543
cached_data: t.Validation<ReadonlyArray<R>>;
5644
}>
5745
> =>
@@ -82,7 +70,6 @@ export const getCachedSheetData =
8270
table.rows,
8371
RA.map(row => ({
8472
...row,
85-
last_row_read: extractLastRowRead(row.last_row_read),
8673
cached_data: extractCachedEvents<R>(row.cached_data),
8774
})),
8875
RA.head

0 commit comments

Comments
 (0)