feat(git): Teilen per Snapshot – snapshotAt im Git-Status, Anzeige im Editor, Tests für alle Leser-Routen (ADR 0003 §6)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
448c67912f
commit
3e05096fd6
5 files changed
+81
-3
No files matched your search
@@ -27,7 +27,7 @@ export const publicConnection = (conn)=>({
|
||||
lastVerifiedAt : conn.lastVerifiedAt
|
||||
});
|
||||
|
||||
const publicStatus = (link, conn, { isConnectionOwner = false } = {})=>link ? {
|
||||
const publicStatus = (link, conn, { isConnectionOwner = false, brew } = {})=>link ? {
|
||||
linked : true,
|
||||
connectionId : conn?.id,
|
||||
connectionLabel : conn?.label,
|
||||
@@ -37,6 +37,7 @@ const publicStatus = (link, conn, { isConnectionOwner = false } = {})=>link ? {
|
||||
lastCommitSha : link.lastCommitSha,
|
||||
lastSyncedAt : link.lastSyncedAt,
|
||||
lastError : link.lastError,
|
||||
snapshotAt : brew?.updatedAt ?? null, // Stand, den Share-Links ausliefern (ADR 0003 §6)
|
||||
isConnectionOwner
|
||||
} : { linked: false };
|
||||
|
||||
@@ -321,7 +322,7 @@ export const createGitService = ({ cfg, getStorage, api, splitTextStyleAndMetada
|
||||
return svc.locks.withKey(brew.id, async ()=>{
|
||||
const { commit, blob } = await svc.commitContent(conn, { branch, filePath, content: brew.text, expectedBlob: null, author });
|
||||
const link = await storage().brewGitLinks.upsert({ brewId: brew.id, connectionId: conn.id, branch, path: filePath, lastCommitSha: commit, lastBlobSha: blob, lastSyncedAt: new Date(), lastError: null });
|
||||
return publicStatus(link, conn, { isConnectionOwner: true });
|
||||
return publicStatus(link, conn, { isConnectionOwner: true, brew });
|
||||
});
|
||||
},
|
||||
|
||||
@@ -339,7 +340,7 @@ export const createGitService = ({ cfg, getStorage, api, splitTextStyleAndMetada
|
||||
const link = await storage().brewGitLinks.findByBrewId(brew.id);
|
||||
if(!link) return { linked: false };
|
||||
const conn = await storage().gitConnections.findById(link.connectionId);
|
||||
return publicStatus(link, conn, { isConnectionOwner: !!account.uid && conn?.ownerUserId === account.uid });
|
||||
return publicStatus(link, conn, { isConnectionOwner: !!account.uid && conn?.ownerUserId === account.uid, brew });
|
||||
},
|
||||
|
||||
async pull(account, editId) {
|
||||
|
||||
Reference in new issue
Block a user