Additional work to include story=true on send

This commit is contained in:
Scott Nonnenberg
2022-10-07 10:02:08 -07:00
committed by GitHub
parent 3bfeffe502
commit 4ec48df5b9
22 changed files with 327 additions and 170 deletions

View File

@@ -3178,6 +3178,7 @@ function saveUnprocessedSync(data: UnprocessedType): string {
serverTimestamp,
decrypted,
urgent,
story,
} = data;
if (!id) {
throw new Error('saveUnprocessedSync: id was falsey');
@@ -3204,7 +3205,8 @@ function saveUnprocessedSync(data: UnprocessedType): string {
serverGuid,
serverTimestamp,
decrypted,
urgent
urgent,
story
) values (
$id,
$timestamp,
@@ -3218,7 +3220,8 @@ function saveUnprocessedSync(data: UnprocessedType): string {
$serverGuid,
$serverTimestamp,
$decrypted,
$urgent
$urgent,
$story
);
`
).run({
@@ -3235,6 +3238,7 @@ function saveUnprocessedSync(data: UnprocessedType): string {
serverTimestamp: serverTimestamp || null,
decrypted: decrypted || null,
urgent: urgent || !isBoolean(urgent) ? 1 : 0,
story: story ? 1 : 0,
});
return id;
@@ -3309,6 +3313,7 @@ async function getUnprocessedById(
return {
...row,
urgent: isNumber(row.urgent) ? Boolean(row.urgent) : true,
story: Boolean(row.story),
};
}
@@ -3370,6 +3375,7 @@ async function getAllUnprocessedAndIncrementAttempts(): Promise<
.map(row => ({
...row,
urgent: isNumber(row.urgent) ? Boolean(row.urgent) : true,
story: Boolean(row.story),
}));
})();
}