fix(frontend): RFC 5545-correct calendar export with tests (#65) - #1003
Merged
Smartdevs17 merged 1 commit intoSep 30, 2026
Merged
Smartdevs17 merged 1 commit into
Smartdevs17 merged 1 commit into
Conversation
…17#65) Calendar export shipped but was not conformant and had drifted: the generator accepted an `allDay` flag and silently ignored it, titles containing commas were truncated because TEXT values were never escaped, long lines were not folded, invalid dates produced unparseable output, and the two project pages emitted different UIDs and descriptions for the same milestones. There were no tests. - generateICS: escape TEXT per RFC 5545 §3.3.11, fold lines at 75 octets without splitting UTF-8 (§3.1), render all-day events with an exclusive DTEND, drop events with unusable dates/UIDs/summaries instead of emitting NaN, and guard downloadICS outside the browser. - project-calendar: one shared builder used by both project pages, emitting a stable event per milestone due date plus a project deadline event that is skipped when a milestone already covers that day. - types/hook: expose the on-chain `deadline` on Project so the deadline event can actually be built. - tests: 43 cases covering escaping, folding, injection of invalid input, the deadline deduplication rule and the project-to-.ics path. - docs: document the event model, UIDs and conformance rules. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@sandrawillow001-afk is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #65.
What already existed
The feature was largely present:
lib/generateICS.ts, an Add to Calendar button, milestone dates and.icsdownload — so three of the four acceptance criteria were met. Re-checking the implementation turned up real defects and zero tests.Defects fixed
allDaywas silently ignored. The localized page passedallDay: true, butICSEventhad no such field, so the intent was dropped and the event was serialised as a timed event.Redesign, phase 2producedSUMMARY:Redesign, phase 2, which most clients truncate at the comma. Now escaped per RFC 5545 §3.3.11 (\,;,,, newlines).DTSTART:NaNundefinedZ, corrupting the whole calendar. Such events are now skipped.UIDs and descriptions for the same milestone. Both now call one shared builder, and UIDs stay stable so re-imports update rather than duplicate.Acceptance criteria
Projectnow exposes the on-chaindeadline(viaformatProjectData), and a dedicated deadline event is emitted.Verification
lib/api.test.ts(2 tests) fails both before and after this change — pre-existing and unrelated.Note
Changing the non-localized page's UIDs to the shared scheme means events previously added from that page will appear once more if re-added; the two pages now agree, which is the point.
🤖 Generated with Codebuff