chore: cleanup unused session types and remove comments

This commit is contained in:
Zack Pollard 2025-08-05 11:22:17 +01:00
parent 246be0086e
commit 9bd86cd688
6 changed files with 11 additions and 23 deletions

View File

@ -46,11 +46,9 @@ class SyncEntityType {
static const albumUserDeleteV1 = SyncEntityType._(r'AlbumUserDeleteV1');
static const albumAssetCreateV1 = SyncEntityType._(r'AlbumAssetCreateV1');
static const albumAssetUpdateV1 = SyncEntityType._(r'AlbumAssetUpdateV1');
static const albumAssetV1 = SyncEntityType._(r'AlbumAssetV1');
static const albumAssetBackfillV1 = SyncEntityType._(r'AlbumAssetBackfillV1');
static const albumAssetExifCreateV1 = SyncEntityType._(r'AlbumAssetExifCreateV1');
static const albumAssetExifUpdateV1 = SyncEntityType._(r'AlbumAssetExifUpdateV1');
static const albumAssetExifV1 = SyncEntityType._(r'AlbumAssetExifV1');
static const albumAssetExifBackfillV1 = SyncEntityType._(r'AlbumAssetExifBackfillV1');
static const albumToAssetV1 = SyncEntityType._(r'AlbumToAssetV1');
static const albumToAssetDeleteV1 = SyncEntityType._(r'AlbumToAssetDeleteV1');
@ -95,11 +93,9 @@ class SyncEntityType {
albumUserDeleteV1,
albumAssetCreateV1,
albumAssetUpdateV1,
albumAssetV1,
albumAssetBackfillV1,
albumAssetExifCreateV1,
albumAssetExifUpdateV1,
albumAssetExifV1,
albumAssetExifBackfillV1,
albumToAssetV1,
albumToAssetDeleteV1,
@ -179,11 +175,9 @@ class SyncEntityTypeTypeTransformer {
case r'AlbumUserDeleteV1': return SyncEntityType.albumUserDeleteV1;
case r'AlbumAssetCreateV1': return SyncEntityType.albumAssetCreateV1;
case r'AlbumAssetUpdateV1': return SyncEntityType.albumAssetUpdateV1;
case r'AlbumAssetV1': return SyncEntityType.albumAssetV1;
case r'AlbumAssetBackfillV1': return SyncEntityType.albumAssetBackfillV1;
case r'AlbumAssetExifCreateV1': return SyncEntityType.albumAssetExifCreateV1;
case r'AlbumAssetExifUpdateV1': return SyncEntityType.albumAssetExifUpdateV1;
case r'AlbumAssetExifV1': return SyncEntityType.albumAssetExifV1;
case r'AlbumAssetExifBackfillV1': return SyncEntityType.albumAssetExifBackfillV1;
case r'AlbumToAssetV1': return SyncEntityType.albumToAssetV1;
case r'AlbumToAssetDeleteV1': return SyncEntityType.albumToAssetDeleteV1;

View File

@ -14946,11 +14946,9 @@
"AlbumUserDeleteV1",
"AlbumAssetCreateV1",
"AlbumAssetUpdateV1",
"AlbumAssetV1",
"AlbumAssetBackfillV1",
"AlbumAssetExifCreateV1",
"AlbumAssetExifUpdateV1",
"AlbumAssetExifV1",
"AlbumAssetExifBackfillV1",
"AlbumToAssetV1",
"AlbumToAssetDeleteV1",

View File

@ -4772,11 +4772,9 @@ export enum SyncEntityType {
AlbumUserDeleteV1 = "AlbumUserDeleteV1",
AlbumAssetCreateV1 = "AlbumAssetCreateV1",
AlbumAssetUpdateV1 = "AlbumAssetUpdateV1",
AlbumAssetV1 = "AlbumAssetV1",
AlbumAssetBackfillV1 = "AlbumAssetBackfillV1",
AlbumAssetExifCreateV1 = "AlbumAssetExifCreateV1",
AlbumAssetExifUpdateV1 = "AlbumAssetExifUpdateV1",
AlbumAssetExifV1 = "AlbumAssetExifV1",
AlbumAssetExifBackfillV1 = "AlbumAssetExifBackfillV1",
AlbumToAssetV1 = "AlbumToAssetV1",
AlbumToAssetDeleteV1 = "AlbumToAssetDeleteV1",

View File

@ -341,11 +341,9 @@ export type SyncItem = {
[SyncEntityType.AlbumUserDeleteV1]: SyncAlbumUserDeleteV1;
[SyncEntityType.AlbumAssetCreateV1]: SyncAssetV1;
[SyncEntityType.AlbumAssetUpdateV1]: SyncAssetV1;
[SyncEntityType.AlbumAssetV1]: SyncAssetV1;
[SyncEntityType.AlbumAssetBackfillV1]: SyncAssetV1;
[SyncEntityType.AlbumAssetExifCreateV1]: SyncAssetExifV1;
[SyncEntityType.AlbumAssetExifUpdateV1]: SyncAssetExifV1;
[SyncEntityType.AlbumAssetExifV1]: SyncAssetExifV1;
[SyncEntityType.AlbumAssetExifBackfillV1]: SyncAssetExifV1;
[SyncEntityType.AlbumToAssetV1]: SyncAlbumToAssetV1;
[SyncEntityType.AlbumToAssetBackfillV1]: SyncAlbumToAssetV1;

View File

@ -668,18 +668,11 @@ export enum SyncEntityType {
AlbumUserBackfillV1 = 'AlbumUserBackfillV1',
AlbumUserDeleteV1 = 'AlbumUserDeleteV1',
AlbumAssetCreateV1 = 'AlbumAssetCreateV1', // album-to-asset table joined to asset table, updateId from album-to-asset, filter out assets owned by you
AlbumAssetUpdateV1 = 'AlbumAssetUpdateV1', // asset table, updateId from asset table, don't send assets where createdAt == updatedAt, filter out assets owned by you
AlbumAssetV1 = 'AlbumAssetV1',
AlbumAssetCreateV1 = 'AlbumAssetCreateV1',
AlbumAssetUpdateV1 = 'AlbumAssetUpdateV1',
AlbumAssetBackfillV1 = 'AlbumAssetBackfillV1',
AlbumAssetExifCreateV1 = 'AlbumAssetExifCreateV1', // album-to-asset table joined to asset-exif table, updateId from album-to-asset, filter out assets owned by you
// If exif isn't created straight away that might cause a problem with the exif createV1, maybe we just send an empty object if it doesn't exist yet?
// We would ack this on album-to-asset table so that would work ok for future syncs
// If exif didn't exist we would send nothing as it would be filtered out when joining from album-to-asset table to the exif table
// Therefore there would be no create event for that asset and it would be skipped forever
// However when the exif is created, we would send an update event for that exif, as the updateId would be new and we no longer filter out exif where createdAt == updatedAt
AlbumAssetExifUpdateV1 = 'AlbumAssetExifUpdateV1', // asset-exif table, updateId from asset-exif table, filter out assets owned by you
AlbumAssetExifV1 = 'AlbumAssetExifV1',
AlbumAssetExifCreateV1 = 'AlbumAssetExifCreateV1',
AlbumAssetExifUpdateV1 = 'AlbumAssetExifUpdateV1',
AlbumAssetExifBackfillV1 = 'AlbumAssetExifBackfillV1',
AlbumToAssetV1 = 'AlbumToAssetV1',

View File

@ -0,0 +1,7 @@
import { Kysely, sql } from 'kysely';
export async function up(db: Kysely<any>): Promise<void> {
await sql`DELETE FROM session_sync_checkpoint WHERE type IN ('AlbumAssetBackfillV1', 'AlbumAssetExifV1', 'AlbumAssetV1')`.execute(db);
}
export async function down(db: Kysely<any>): Promise<void> {}