feat(sync): paginate Android sync with change tokens
Lint / Lint (push) Successful in 1m8s
Tests / Go backend (push) Failing after 1m23s
Tests / Dashboard checks (push) Failing after 38s
Docker / Docker Build & Push (push) Failing after 6m29s

This commit is contained in:
Gabriel20xx committed 2026-10-20 15:27:53 +00:00
1 parent 0ff94f9b10
commit 97c237be80
76 files changed
+3401 -851

No files matched your search

+11
View File
@@ -8,6 +8,7 @@
"name": "collabtable-server-frontend",
"version": "1.0.0",
"dependencies": {
"@gabriel20xx/design-tokens": "file:../shared/packages/design-tokens",
"@gabriel20xx/web-ui": "file:../shared/packages/web-ui",
"@lucide/svelte": "latest",
"@tanstack/svelte-query": "latest",
@@ -34,11 +35,17 @@
"vite": "latest"
}
},
"../shared/packages/design-tokens": {
"name": "@gabriel20xx/design-tokens",
"version": "0.1.1",
"license": "MIT"
},
"../shared/packages/web-ui": {
"name": "@gabriel20xx/web-ui",
"version": "0.1.1",
"license": "MIT",
"dependencies": {
"@gabriel20xx/design-tokens": "0.1.1",
"@lucide/svelte": "1.28.0"
},
"devDependencies": {
@@ -236,6 +243,10 @@
"integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==",
"license": "MIT"
},
"node_modules/@gabriel20xx/design-tokens": {
"resolved": "../shared/packages/design-tokens",
"link": true
},
"node_modules/@gabriel20xx/web-ui": {
"resolved": "../shared/packages/web-ui",
"link": true
+2 -1
View File
@@ -31,7 +31,8 @@
"vite": "latest"
},
"dependencies": {
"@gabriel20xx/web-ui": "file:../shared/packages/web-ui",
"@gabriel20xx/design-tokens": "file:../shared/packages/design-tokens",
"@gabriel20xx/web-ui": "file:../shared/packages/web-ui",
"@lucide/svelte": "latest",
"@tanstack/svelte-query": "latest",
"bits-ui": "latest",
+5 -4
View File
@@ -120,12 +120,13 @@ export async function logout() {
// always be the account's current values when the caller isn't actually
// changing them. ProfileDialog's form (@gabriel20xx/web-ui) always pre-fills
// and requires both fields, so AppShell.svelte's saveProfile always has them
// on hand. newPassword remains genuinely optional (omitted/blank leaves the
// password unchanged).
export async function updateCredentials({ newUsername, newEmail, newPassword }) {
// on hand. When changing the password, the shared ProfileDialog also supplies
// currentPassword and (when enabled) totpToken for sharedauth's reauthentication
// check. newPassword remains optional when it is not being changed.
export async function updateCredentials({ newUsername, newEmail, newPassword, currentPassword, totpToken }) {
return request('/api/auth/credentials', {
method: 'POST',
body: JSON.stringify({ username: newUsername, email: newEmail, password: newPassword }),
body: JSON.stringify({ username: newUsername, email: newEmail, password: newPassword, currentPassword, totpToken }),
});
}
+53
View File
@@ -0,0 +1,53 @@
import assert from 'node:assert/strict';
import { test } from 'node:test';
import { updateCredentials } from './api.js';
test('updateCredentials forwards current password and TOTP proof', async () => {
const originalFetch = globalThis.fetch;
let captured;
globalThis.fetch = async (url, options) => {
captured = { url, options };
return { ok: true, status: 200, json: async () => ({}) };
};
try {
await updateCredentials({
newUsername: 'owner',
newEmail: 'owner@example.com',
newPassword: 'new-password',
currentPassword: 'current-password',
totpToken: '123456',
});
assert.equal(captured.url, '/api/auth/credentials');
assert.deepEqual(JSON.parse(captured.options.body), {
username: 'owner',
email: 'owner@example.com',
password: 'new-password',
currentPassword: 'current-password',
totpToken: '123456',
});
} finally {
globalThis.fetch = originalFetch;
}
});
test('updateCredentials omits reauthentication proof when password is unchanged', async () => {
const originalFetch = globalThis.fetch;
let captured;
globalThis.fetch = async (_url, options) => {
captured = options;
return { ok: true, status: 200, json: async () => ({}) };
};
try {
await updateCredentials({ newUsername: 'owner', newEmail: 'owner@example.com' });
assert.deepEqual(JSON.parse(captured.body), {
username: 'owner',
email: 'owner@example.com',
});
} finally {
globalThis.fetch = originalFetch;
}
});
@@ -30,6 +30,8 @@
newUsername: input.username.trim(),
newEmail: input.email.trim(),
newPassword: input.password || undefined,
currentPassword: input.currentPassword,
totpToken: input.totpToken,
});
}
</script>
+3
View File
@@ -30,6 +30,9 @@ const frontendTechStack = FRONTEND_TECH_STACK_PACKAGES.flatMap(({ name, pkg }) =
export default defineConfig({
plugins: [tailwindcss(), sveltekit()],
resolve: {
preserveSymlinks: true,
},
define: {
__FRONTEND_TECH_STACK__: JSON.stringify(frontendTechStack),
},