Commit graph

8 commits

Author SHA1 Message Date
f8a853a80c chore: minor fixes from final review (Dockerfile reproducibility, Caddy directive, em dash)
M3: frontend/Dockerfile now copies package-lock.json and uses npm ci instead
of npm install, for reproducible builds.

M4: replace em dash with plain hyphen in manual_share.py's attachment-only
fallback text (standing style preference; ping.py title and
TriageList.vue's sender fallback were already fixed in prior commits).

M5: Caddyfile.snippet uses basic_auth instead of the deprecated basicauth
directive alias (Caddy 2.8+).

M1/M2/M6 (unused discord import removal, None-payload guard in
_extract_body, discord.NotFound guard in thread_ingest.py) were already
included in the preceding two commits since they touched the same files.
2026-07-13 15:01:46 -07:00
73fb67b3bf fix: cog re-registration, thread NotFound, follow-up date, and error/empty states
I1: move cog registration + tree.sync into ChorusBot.setup_hook (called once
before gateway connect) instead of on_ready (fires on every reconnect),
preventing duplicate cogs/listeners/poll loops after a gateway RESUME.

I2 (email_ingest.py, addressed alongside I1 for IMAP stability): none here,
handled separately.

I3/I4: TriageList.vue now renders a follow_up_date column so it actually
surfaces back to Donna. App.vue adds a "Show completed" checkbox bound to
includeDone, matching what docs/smoke-test.md step 7 already describes.

I5: add frontend/tests/ItemModal.spec.js covering stagesForType() options
for donation/other/unset types and the type-change stage reset regression.

I6: App.vue wraps loadItems/openItem in try/catch with a calm (no-panic)
error message, and shows calm empty-state copy when there are zero items.

Also fixes thread_ingest.py: standalone threads not started from a message
raise discord.NotFound on fetch_message; now caught and returns early.
2026-07-13 15:01:32 -07:00
75ee9f8117 fix: prevent Discord embed field 400s from empty/oversized values
C1: build_ping_embed set sender_id field value="" whenever sender_id was
None, which manual_share.py always passes -- Discord rejects empty embed
field values (min length 1), so every manual-share ping failed to send.
Fixed by using a zero-width space sentinel that round-trips back to ""
(raw_content) or None (sender_id) in parse_ping_embed. Added regression
tests asserting no field value is ever empty after build_ping_embed runs.

C2: raw_content over 1024 chars (Discord's embed field cap) caused
inbox.send() to raise before the UID was marked seen, so oversized emails
were retried forever and never ingested. Added a defensive hard truncation
in build_ping_embed itself, plus an explicit truncation in email_ingest.py
before the embed is built (lossy for very long emails, acceptable for MVP).
2026-07-13 15:01:23 -07:00
b9c0eda8b5 feat(bot): add subscribe/unsubscribe commands and bot bootstrap 2026-07-13 14:16:28 -07:00
f1bf86a5c9 fix(bot): preserve HTML body content and isolate mailbox poll failures
_extract_body previously discarded real HTML content, replacing it with
a placeholder whenever a multipart email had no text/plain part. Now
falls back to the raw text/html payload before giving up, only using
the placeholder when a message has no text-bearing part at all.

poll_mailboxes also had no error isolation: an unhandled IMAP exception
from any one mailbox would stop the discord.ext.tasks.Loop permanently,
silently killing ingestion for all three mailboxes. Each mailbox's poll
is now wrapped in try/except so one failure doesn't block the others.
2026-07-13 14:12:46 -07:00
f4b57238d2 feat(bot): add email ingestion polling and thread-open triage creation 2026-07-13 14:07:53 -07:00
d86cfd2d3d fix: preserve true message content in raw_content for attachment-only messages
Separate display snippet from raw_content: use actual message.content
for raw_content (which may be empty string) and only use the placeholder
string for the display snippet. This matches the precedent from Task 5's
ping.py where build_ping_embed must never substitute raw_content with a
placeholder, preserving the factual state of whether content was present.
2026-07-13 14:04:48 -07:00
8d8761a79d feat(bot): add manual-share cog forwarding channel messages to #inbox 2026-07-13 14:00:56 -07:00