Skip to content

Skip redundant library sync when other user has access#48

Merged
Majorfi merged 1 commit into
developfrom
feat/skip-redundant-library-sync
May 28, 2026
Merged

Skip redundant library sync when other user has access#48
Majorfi merged 1 commit into
developfrom
feat/skip-redundant-library-sync

Conversation

@Majorfi

@Majorfi Majorfi commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

Optimize the library sync process by skipping redundant syncs when another user already has access to the same library. This reduces unnecessary database operations and improves sync efficiency in multi-user scenarios.

What changed

  • Added database method to check if another user has access to a library
  • Updated sync service logic to skip syncing when access already exists via another user
  • Extended interfaces to support the new access check
  • Added comprehensive unit tests for both the database check and sync service behavior (50+ test lines)

Risks

  • Verify access checks work correctly across different permission scenarios
  • Test sync behavior with shared libraries and concurrent user access
  • Monitor edge cases where permissions change during sync operations
  • Ensure the optimization doesn't hide legitimate sync needs

Test plan

  • Run full test suite to verify no regressions
  • Test sync with multiple users accessing the same library
  • Verify sync is correctly skipped when another user has access
  • Verify sync proceeds normally when only the current user has access
  • Performance test with large libraries and multiple users

Docs impact

None

Breaking changes

None

When a user lacks library access permissions (403 from Immich API), check if any other user in the account has access before syncing. If another user has access, skip the sync to avoid redundant API calls and reduce load on shared library permissions.

This caches the access state and retries the API call if it was previously denied, allowing for permission changes to take effect on the next sync cycle.

Change-Type: feature
Scope: sync
@Majorfi Majorfi changed the base branch from main to develop May 28, 2026 13:27
@Majorfi Majorfi merged commit 41b0b7d into develop May 28, 2026
3 checks passed
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