Skip to content

feat(dav): store multiple default calendar alarms as JSON - #6

Open
rich0 wants to merge 1 commit into
temp/old-masterfrom
fix/drop-legacy-default-alarms
Open

feat(dav): store multiple default calendar alarms as JSON#6
rich0 wants to merge 1 commit into
temp/old-masterfrom
fix/drop-legacy-default-alarms

Conversation

@rich0

@rich0 rich0 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

Clean rebuild of the plural default calendar alarms feature on top of temp/old-master (the effective upstream starting point for this work). No dual-write / legacy conversion path.

Addresses upstream review on nextcloud#61832 and drift cleanup on this fork:

  • Replace singular default-alarm-* int properties with plural default-alarms-* JSON text via propertyMap only (same inline property-name style as neighboring entries — no special constants)
  • No DefaultCalendarAlarms helper, dual-write, or storage-backend validation
  • Migration 1040: add JSON columns + two set-based QueryBuilder CONCAT UPDATEs (not per-row PHP)
  • Migration 1041: drop default_alarm_pday / default_alarm_fday
  • Tests updated for plural JSON set/update/clear only

Base

temp/old-master — intentional. Diff is only the feature relative to that base.

Not in this PR

  • Calendar app / library NC34 fallbacks (follow-up; feature-gate to 35+)
  • Rebase onto current master / upstream tip (later)
  • No changes pushed to nextcloud/server by this PR

AI assistance

Assisted by Grok (xAI). Human DCO sign-off still required before upstream.

Test plan

  • Unit: CalDavBackendTest::testDefaultAlarmsProperties
  • Diff vs temp/old-master is only dav propertyMap, migrations 1040/1041, autoload, and tests
  • Upgrade: int defaults → JSON after 1040; int columns gone after 1041
  • PROPPATCH/PROPFIND plural props only

Comment thread apps/dav/lib/CalDAV/CalDavBackend.php Outdated
Comment thread apps/dav/lib/CalDAV/CalDavBackend.php Outdated
$fields = array_map(function (string $field) {
return 'a.' . $field;
}, $this->getCalendarMergeSerializedProperties());
}, array_column($this->propertyMap, 0));

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we've drifted a bit from temp/old-master which was what we started with from upstream. Maybe we need to base off of that instead?

@rich0
rich0 force-pushed the fix/drop-legacy-default-alarms branch from e52bc86 to c0f1fe7 Compare August 11, 2026 10:13
@rich0 rich0 changed the title refactor(dav): address review — drop legacy default-alarm dual-write feat(dav): store multiple default calendar alarms as JSON Aug 11, 2026
@rich0
rich0 changed the base branch from upstreampr/pluralcalendardefaults to temp/old-master August 11, 2026 10:13
@rich0

rich0 commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

Rebased/cleaned against temp/old-master as the effective base:

  1. Dropped incidental drift (inlined array_map / array_column churn from intermediate commits; no behavioral change intended there).
  2. Dropped DEFAULT_ALARMS_* constants — propertyMap entries use the same inline property-name style as the rest of the map.
  3. Single clean commit with only feature-related files: propertyMap swap, migrations 1040+1041, autoload, tests.
  4. PR base retargeted from upstreampr/pluralcalendardefaultstemp/old-master.

Happy to adjust further if anything still looks off.

* Add JSON default-alarm columns and copy legacy single-int defaults in bulk.
*
* Conversion uses two set-based UPDATEs so large calendars tables stay fast
* (avoids per-row PHP updates).

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shorten - we don't need to describe what we're not doing.

@rich0
rich0 force-pushed the fix/drop-legacy-default-alarms branch from 32d6b8b to de256e1 Compare August 11, 2026 10:32
Replace singular default-alarm-* integer properties with plural
default-alarms-* JSON text columns. Migrate existing int defaults
with two set-based QueryBuilder UPDATEs, then drop the legacy columns.
No dual-write or server-side validation; propertyMap stores/retrieves
JSON strings only (NC 35+ clients).

Assisted-by: Grok:grok-4.5
@rich0
rich0 force-pushed the fix/drop-legacy-default-alarms branch from de256e1 to 940dae8 Compare August 11, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant