Skip to content

Settings → Organization shows stale/default 90-day retention while Admin shows correct value #288

Description

@SemoTech

Summary

After updating an organization's log retention via Admin → Organizations → [org] → Retention Period, the read-only display on Settings → Organization (/dashboard/settings/general) continues to show 90 days, even though Admin correctly shows the updated value (e.g. 365 days).

Hard refresh of the Settings page does not fix it. Admin remains accurate.

Environment

  • Self-hosted LogTide (Docker / Portainer)
  • Org Settings (member UI): read-only retention card
  • Admin Organizations detail: editable retention field

Steps to reproduce

  1. As a platform admin, open Admin → Organizations → [organization].
  2. Set Retention Period (days) to 365 and save.
  3. Confirm Admin still shows 365.
  4. Open Settings → Organization (/dashboard/settings/general).
  5. Observe Log Retention Policy still shows 90 days.
  6. Hard-refresh Settings — value remains 90.

Expected

Settings → Organization should show the same retention as Admin / the database (organizations.retention_days), e.g. 365 days.

Actual

Settings shows 90 days (looks like a default/fallback), while Admin shows the correct 365 days.

Likely cause (from frontend build inspection)

On the Settings general page, retention is rendered from the client org store / cached currentOrganization:

{currentOrg?.retentionDays || 90} days

Admin loads retention via getOrganizationDetails() (fresh API), so it stays correct.

Suspected contributing factors:

  1. || 90 fallback — if retentionDays is missing/undefined on the cached org object, the UI always displays 90 even when the server has another value.
  2. Stale localStorage org cache (currentOrganization) — Settings appears to read the cached org object and does not re-fetch retention when opening the page after an Admin retention update.

Suggested fix

  • Re-fetch organization (or at least retention) when opening Settings → Organization, or update the org store after Admin retention save so all views stay in sync.
  • Prefer nullish coalescing with an explicit fetch over retentionDays || 90 so a missing field does not silently look like a policy of 90 days (or show a loading/error state instead).

Impact

Operators believe retention is still 90 days and may “fix” it again or distrust Admin, even though cleanup already uses the Admin/DB value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions