1
0
mirror of https://github.com/aziascreations/BakaShrot.git synced 2026-11-23 20:58:46 +01:00
Commit Graph

3 Commits

Author SHA1 Message Date
aziascreations df61ef9719 Add attachments (protocol 4), their edge-case tests, and handoff docs
- One optional attachment per message, any size up to the server's
  MaxAttachmentSize (default 1G), sent and stored in 1 MB parts, checked
  with its SHA-256. Uploaded before its message (UploadStart, UploadChunk),
  then attached by the PushMessage in the same transaction; uploads never
  pushed expire after UploadTimeout. Read back a part at a time
  (GetAttachment).
- Replicated separately, after the messages: the message carries the size
  and SHA-256, then each check-in lists what the peer is missing
  (MissingAttachments) and sends the parts from where it stopped. Over the
  receiver's limit, the attachment is marked not kept.
- Deleted with its message by the retention, parts cleaned up in the
  background. Schema v7 (attachments, blobs, blob_chunks), replacing the
  unused attachements table.
- DLL: PushMessageWithFile/WithData, SaveAttachment, LoadAttachment,
  GetMessageAttachmentSize, IsMessageAttachmentReady. Python: push(...,
  attachment=), get_attachment(), save_attachment(). Tools: PushMessage -a,
  GetAttachment. The release smoke test round-trips one.
- Tests/Attachments-Test.ps1 (39 checks) and Tests/AttachmentEdges-Test.ps1
  (51 checks, with a raw protocol client): wrong SHA-256, bad parts,
  others' uploads, expiry, replication resuming after a kill, a corrupted
  stored copy. Found: a corrupted copy is re-sent to peers forever, noted
  as open item 3 in Notes.md with a proposed fix.
- CLAUDE.md: how to build, test, the traps and working rules, for the next
  session. Notes.md and the Design docs updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RwFeVPXGLs3KK1MAQn3ouP
2026-11-08 18:56:15 +01:00
aziascreations 9caf816dca Add pushed_at timestamps and per-topic retention
- Every message is stamped with the time its push arrived (UTC ms since
  1970, the server's clock), carried as is by replication. Exposed in
  LatestMessage and Messages, BakaShrot_GetMessagePushedAt() in the DLL,
  Message.pushed_at / .pushed in Python, GetMessages --time,
  GetLatestMessage, and the messages view (pushed_at, pushed_utc).
- [BakaShrot.Retention] in each server's config: a max age per topic, by
  name, id, pattern or *, ages like 30d or 1d12h. A background pass
  (Server/Storage/Retention.pbi, every RetentionInterval seconds) deletes
  what's older, in batches through the writer. node_heads is left as is,
  so ids never go back and peers don't resend what was deleted.
- Replicated messages already past the receiver's max age are skipped on
  arrival, their head still raised so they aren't sent again.
- Schema v6: data.pushed_at (older databases stamped at upgrade time),
  a (topic_id, pushed_at) index, the unused archives table dropped. The
  writer takes the next id from node_heads.
- Folded into protocol 3, not released yet.
- Tests/Retention-Test.ps1 (52 checks), Python checks for pushed_at.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RwFeVPXGLs3KK1MAQn3ouP
2026-11-08 17:01:48 +01:00
aziascreations 12fbe5f4da Got close to the final version
comitting Claude's code before the last mile improvements
2026-11-08 13:16:37 +01:00