Skip to content

Refactor tasklist cache and sync list handling#28

Merged
ralflang merged 1 commit into
FRAMEWORK_6_0from
refactor/listmanagement
May 28, 2026
Merged

Refactor tasklist cache and sync list handling#28
ralflang merged 1 commit into
FRAMEWORK_6_0from
refactor/listmanagement

Conversation

@TDannhauer

Copy link
Copy Markdown
Contributor

Nag: conditional web session refresh for task list changes

Summary

Adopts the Kronolith pattern for keeping the Nag web UI in sync when task lists change via ActiveSync or another session, without reloading prefs and share caches on every page view.

Problem

With horde/nag#25, refreshWebSessionState() ran on every Nag request (prefs->cleanup() / retrieve() plus share list cache expiry). That works but is costly (review comment). List changes from iOS or a second browser tab also need other web sessions to notice without a full logout.

Solution

  • Store a lightweight invalidation marker in Horde_Cache (nag.tasklist_cache_ts.<user>), not in user preferences.
  • On each web request, compare the marker with tasklist_cache_ts in the PHP session; run the expensive reload only when the marker is newer.
  • Call markTasklistCacheChanged() from notifyActiveSyncOfTaskListChange() (always, even if ActiveSync is disabled) and when adding a display-only task list.
  • On reload: prune stale display_tasklists / sync_lists, refresh default and sync lists (getSyncLists(true)), persist prefs, update session marker.

ActiveSync device cache behaviour from #25 is unchanged (hierarchy = 0, no prune in notify, collection-only delete).

Files changed

  • lib/Nag.php

Test plan

  • Open Nag in the browser; normal navigation — no new errors in horde.log.
  • With another session or iOS: create, rename, or delete a task list; reload Nag in the browser without logout — lists match, no access errors.
  • Confirm ActiveSync folder sync still works (activesync_no_multiplex + sync_lists).

@TDannhauer TDannhauer requested a review from ralflang May 27, 2026 17:19
@TDannhauer TDannhauer mentioned this pull request May 27, 2026
6 tasks
@ralflang ralflang merged commit 865841f into FRAMEWORK_6_0 May 28, 2026
1 check failed
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.

2 participants