Skip to content

feat(AuditLog): Add the organisation audit log page - #8940

Open
talissoncosta wants to merge 6 commits into
mainfrom
feat/org-audit-log-page
Open

talissoncosta wants to merge 6 commits into
mainfrom
feat/org-audit-log-page

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to #8889

The organisation audit log page, on the endpoints from #8921. It sits behind the organisation_audit_log flag and is shown to organisation admins only.

  • New Audit Log tab in the organisation nav.
  • Logs grouped by day. Each row shows the project and environment, and expands to the field changes. When a log has no field changes, the row links to the related object instead.
  • Search, Clear all and paging. The search lives in the URL.
  • Loading, empty, no access and error states.

A new list rather than the project page's AuditLog: it uses no Flux stores, so the project page can move onto it later.

Shared changes, not behind the flag:

  • Accordion gets a controlled open and a row variant, and the rows use it. Its other users (release pipeline status, environment metrics, pending change requests) keep the card look.
  • ColorSwatch takes children and an xl size. The project initial in each row is built on it.
  • The project palette and contrast colour move out of Utils into paletteColour, so Jest can test them. Utils still exports them, so existing callers don't change.
  • New --always-black token, the pair of --always-white, for the initial on light palette colours.

Next: filtering by scope (#8941), then the stories and the RTL tests.

How did you test this code?

  • Unit tests for the filters, URL round trip, day grouping, error kinds, related object links and palette colours.
  • By hand against a local API: with the flag on, open Organisation → Audit Log, search, expand a row and page through.

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Nov 13, 2026 12:54pm UTC
flagsmith-frontend-staging Ready Ready Preview Nov 13, 2026 12:54pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 13, 2026 12:54pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Adds organisation audit-log queries and types, plus a feature-gated organisation page with filtering, paging and expanded change details. Adds audit-log display components and helpers for grouping, labelling, error handling and related-object links. Updates Accordion and ColorSwatch, adds project-colour utilities and theme tokens, and moves version-limit checking into a shared utility.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: Low · up to d6908

The organisation audit log page is flag-gated and has a few small UI correctness gaps: a pending search can reappear after navigating away, emoji project initials render broken, a filter can restore an old page, and a failed permission check shows no error. None of these is likely to block use, so the change is mergeable with follow-up fixes.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4fbefb16-abe3-497c-aa4c-4ddd5012016a
Commits

Reviewing files that changed from the base of the PR and between cdb50e5 and d6908d2.

Files ignored due to path filters: 1

  • frontend/documentation/TokenReference.generated.stories.tsx is excluded by !**/*.generated.*
Files selected for processing: 1

  • frontend/common/utils/paletteColour.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@github-actions github-actions Bot added front-end Issue related to the React Front End Dashboard feature New feature or request labels Nov 12, 2026
@github-actions github-actions Bot removed the feature New feature or request label Nov 12, 2026
@github-actions github-actions Bot added the feature New feature or request label Nov 12, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Nov 12, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Nov 12, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Nov 12, 2026
@talissoncosta
talissoncosta force-pushed the feat/org-audit-log-page branch from 323daba to bf74ed0 Compare November 12, 2026 12:06
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Nov 12, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-8940 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-8940 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-8940 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith:pr-8940 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-frontend:pr-8940 Finished ✅ Results ✅

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #23140 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  5 passed

Details

stats  5 tests across 4 suites
duration  35.4 seconds
commit  d6908d2
info  🔄 Run: #23140 (attempt 1)

🗂️ Previous results
✅ private-cloud · depot-ubuntu-latest-16 — run #23140 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  6 passed

Details

stats  6 tests across 5 suites
duration  52.8 seconds
commit  d6908d2
info  🔄 Run: #23140 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #23140 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  33.7 seconds
commit  d6908d2
info  🔄 Run: #23140 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #23139 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  4 passed

Details

stats  4 tests across 3 suites
duration  45.5 seconds
commit  cdb50e5
info  🔄 Run: #23139 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #23140 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  31.3 seconds
commit  d6908d2
info  🔄 Run: #23140 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #23139 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  7 passed

Details

stats  7 tests across 5 suites
duration  54.4 seconds
commit  cdb50e5
info  🔄 Run: #23139 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #23139 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  35.6 seconds
commit  cdb50e5
info  🔄 Run: #23139 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #23139 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  32.5 seconds
commit  cdb50e5
info  🔄 Run: #23139 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #23138 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  5 passed

Details

stats  5 tests across 4 suites
duration  19.6 seconds
commit  09a967c
info  🔄 Run: #23138 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #23138 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  7 passed

Details

stats  7 tests across 6 suites
duration  54.7 seconds
commit  09a967c
info  🔄 Run: #23138 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #23138 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.6 seconds
commit  09a967c
info  🔄 Run: #23138 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #23138 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  31.3 seconds
commit  09a967c
info  🔄 Run: #23138 (attempt 1)

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 56 files

Confidence score: 5/5

  • auditLogFilters.test.ts is missing the required Given/When/Then markers, which makes the tests less consistent with the expected structure. Add the markers to each test.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/web/components/audit-log/__tests__/auditLogFilters.test.ts">

<violation number="1" location="frontend/web/components/audit-log/__tests__/auditLogFilters.test.ts:8">
P3: These tests omit the required Given/When/Then structure. Add `// Given`, `// When`, and `// Then` markers to each test.</violation>
</file>

Reply to a comment to ask cubic a question or push back. It learns from your replies.
Click Fix with cubic on a comment, or reply @cubic-dev-ai fix this, and cubic writes the fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread frontend/common/types/responses.ts Resolved
Comment thread frontend/common/types/responses.ts Resolved
Comment thread frontend/web/components/ColorSwatch.tsx Resolved
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Visual Regression

24 screenshots compared. See report for details.
View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4f97fa30-ebdc-47bb-99bd-7ece28f94e76
Commits

Reviewing files that changed from the base of the PR and between e1d64e6 and e9f0e54.

Files ignored due to path filters: 1

  • frontend/documentation/TokenReference.generated.stories.tsx is excluded by !**/*.generated.*
Files selected for processing: 55

  • frontend/common/constants.ts
  • frontend/common/services/useAuditLog.ts
  • frontend/common/services/useAuditLogItem.ts
  • frontend/common/theme/tokens.json
  • frontend/common/theme/tokens.ts
  • frontend/common/types/requests.ts
  • frontend/common/types/responses.ts
  • frontend/common/utils/__tests__/paletteColour.test.ts
  • frontend/common/utils/getUserDisplayName.tsx
  • frontend/common/utils/paletteColour.ts
  • frontend/common/utils/utils.tsx
  • frontend/documentation/components/Accordion.stories.tsx
  • frontend/documentation/components/ColorSwatch.stories.tsx
  • frontend/web/components/AuditLog.tsx
  • frontend/web/components/ColorSwatch.tsx
  • frontend/web/components/audit-log/AuditLogChanges.tsx
  • frontend/web/components/audit-log/AuditLogList/AuditLogDay.tsx
  • frontend/web/components/audit-log/AuditLogList/AuditLogList.scss
  • frontend/web/components/audit-log/AuditLogList/AuditLogList.tsx
  • frontend/web/components/audit-log/AuditLogList/AuditLogListEmpty.tsx
  • frontend/web/components/audit-log/AuditLogList/AuditLogListError.tsx
  • frontend/web/components/audit-log/AuditLogList/LoadingRows.tsx
  • frontend/web/components/audit-log/AuditLogList/index.ts
  • frontend/web/components/audit-log/AuditLogNoAccess.tsx
  • frontend/web/components/audit-log/AuditLogRow/AuditLogMessage.tsx
  • frontend/web/components/audit-log/AuditLogRow/AuditLogRow.scss
  • frontend/web/components/audit-log/AuditLogRow/AuditLogRow.tsx
  • frontend/web/components/audit-log/AuditLogRow/AuditLogScopeChip.tsx
  • frontend/web/components/audit-log/AuditLogRow/AuditLogTypeIcon.tsx
  • frontend/web/components/audit-log/AuditLogRow/index.ts
  • frontend/web/components/audit-log/OrganisationAuditLogChanges.tsx
  • frontend/web/components/audit-log/OrganisationAuditLogFilters/OrganisationAuditLogFilters.scss
  • frontend/web/components/audit-log/OrganisationAuditLogFilters/OrganisationAuditLogFilters.tsx
  • frontend/web/components/audit-log/OrganisationAuditLogFilters/index.ts
  • frontend/web/components/audit-log/ProjectInitial/ProjectInitial.scss
  • frontend/web/components/audit-log/ProjectInitial/ProjectInitial.tsx
  • frontend/web/components/audit-log/ProjectInitial/index.ts
  • frontend/web/components/audit-log/__tests__/auditLogError.test.ts
  • frontend/web/components/audit-log/__tests__/auditLogFilters.test.ts
  • frontend/web/components/audit-log/__tests__/auditLogHelpers.test.ts
  • frontend/web/components/audit-log/__tests__/getAuditLogRelatedObjectLink.test.ts
  • frontend/web/components/audit-log/auditLogError.ts
  • frontend/web/components/audit-log/auditLogFilters.ts
  • frontend/web/components/audit-log/auditLogScope.ts
  • frontend/web/components/audit-log/auditLogTypeIcon.ts
  • frontend/web/components/audit-log/getAuditLogRelatedObjectLink.ts
  • frontend/web/components/audit-log/groupAuditLogsByDay.ts
  • frontend/web/components/audit-log/useAuditLogFilters.ts
  • frontend/web/components/base/Accordion/Accordion.scss
  • frontend/web/components/base/Accordion/Accordion.tsx
  • frontend/web/components/base/Accordion/index.ts
  • frontend/web/components/navigation/navbars/OrganisationNavbar.tsx
  • frontend/web/components/pages/OrganisationAuditLogPage.tsx
  • frontend/web/routes.js
  • frontend/web/styles/_tokens.scss
Files with no reviewable changes: 1

  • frontend/common/constants.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 10 unresolved issues from previous reviews.
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Turn on auto-fix | Re-trigger cubic

talissoncosta and others added 5 commits November 12, 2026 17:45
…eir own module

Utils pulls in Flux stores, so its functions can't be tested with Jest. Utils still re-exports them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The item type now mirrors the API, so the old project page links versions with its own project id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Behind organisation_audit_log, for organisation admins: logs grouped by day, rows that expand to their changes, search kept in the URL, and paging.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@Zaimwa9 Zaimwa9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One minor comment I'd say worth to address as we are on it

Comment thread frontend/common/utils/paletteColour.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6340e8d1-bd77-4efe-9ec5-6ceefef4dd1f
Commits

Reviewing files that changed from the base of the PR and between 2d02966 and 576385a.

Files ignored due to path filters: 1

  • frontend/documentation/TokenReference.generated.stories.tsx is excluded by !**/*.generated.*
Files selected for processing: 13

  • frontend/common/services/useFeatureVersion.ts
  • frontend/common/types/responses.ts
  • frontend/common/utils/isVersionOverLimit.ts
  • frontend/web/components/audit-log/AuditLogChanges.tsx
  • frontend/web/components/audit-log/AuditLogRow/AuditLogMessage.tsx
  • frontend/web/components/audit-log/AuditLogRow/AuditLogTypeIcon.tsx
  • frontend/web/components/audit-log/OrganisationAuditLogChanges.tsx
  • frontend/web/components/audit-log/__tests__/auditLogHelpers.test.ts
  • frontend/web/components/audit-log/__tests__/getAuditLogRelatedObjectLink.test.ts
  • frontend/web/components/audit-log/auditLogType.ts
  • frontend/web/components/audit-log/getAuditLogRelatedObjectLink.ts
  • frontend/web/components/audit-log/useAuditLogFilters.ts
  • frontend/web/components/pages/OrganisationAuditLogPage.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 10 unresolved issues from previous reviews.

View guided diff | Turn on auto-fix | Re-trigger cubic

The Projects page orders tiles by name with capitals first, while the
projects query sorts ignoring case, so some initials got another colour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@talissoncosta

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@talissoncosta I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

4 issues found across 58 files

Confidence score: 3/5

  • isVersionOverLimit.ts treats a zero-day limit as unlimited, leaving old version rows linkable. Treat only null and undefined as unlimited.
  • OrganisationAuditLogPage.tsx hides the upgrade banner for the configured zero-day free-plan limit. Check for null or undefined instead of using a truthiness check.
  • AuditLogList.tsx can briefly show “No changes match” while a filter refetch is still loading. Gate the empty state on !isLoading.
  • auditLogError.ts doesn’t recognize the audit endpoint’s timeout response, so timed-out searches show a generic error. Classify the endpoint’s actual timeout response.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/common/utils/isVersionOverLimit.ts">

<violation number="1" location="frontend/common/utils/isVersionOverLimit.ts:8">
P2: A zero-day limit means feature history is unavailable, but this guard treats it like no limit and leaves old version rows linkable. Treat only `null`/`undefined` as unlimited and compare zero-day limits normally.</violation>
</file>

<file name="frontend/web/components/pages/OrganisationAuditLogPage.tsx">

<violation number="1" location="frontend/web/components/pages/OrganisationAuditLogPage.tsx:81">
P2: `0` is the configured free-plan limit and the API applies it, but this truthiness check suppresses the upgrade banner. Check for `null`/`undefined` so zero-day plans see why their log is empty.</violation>
</file>

<file name="frontend/web/components/audit-log/AuditLogList/AuditLogList.tsx">

<violation number="1" location="frontend/web/components/audit-log/AuditLogList/AuditLogList.tsx:39">
P2: A refetch with a previously empty result returns the empty state while the request is still loading, so changing filters can briefly show “No changes match” before new results arrive. Gate the empty state on `!isLoading` and render loading rows when an empty result is being fetched.</violation>
</file>

<file name="frontend/web/components/audit-log/auditLogError.ts">

<violation number="1" location="frontend/web/components/audit-log/auditLogError.ts:19">
P2: The audit endpoint does not translate query timeouts into a `503` response with `data.code = 'statement_timeout'`, so timed-out searches fall through to the generic error message. Classify the endpoint’s actual timeout response or add that mapping on the API side.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

versionLimitDays: number | null | undefined,
date: string | undefined,
) {
if (!versionLimitDays) {

@cubic-dev-ai cubic-dev-ai Bot Nov 13, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: A zero-day limit means feature history is unavailable, but this guard treats it like no limit and leaves old version rows linkable. Treat only null/undefined as unlimited and compare zero-day limits normally.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/common/utils/isVersionOverLimit.ts, line 8:

<comment>A zero-day limit means feature history is unavailable, but this guard treats it like no limit and leaves old version rows linkable. Treat only `null`/`undefined` as unlimited and compare zero-day limits normally.</comment>

<file context>
@@ -0,0 +1,13 @@
+  versionLimitDays: number | null | undefined,
+  date: string | undefined,
+) {
+  if (!versionLimitDays) {
+    return false
+  }
</file context>
Fix with cubic

{isAdminChecked && !isAdmin && <AuditLogNoAccess />}
{isAdmin && (
<div className='d-flex flex-column gap-3'>
{!!auditLimitDays && (

@cubic-dev-ai cubic-dev-ai Bot Nov 13, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: 0 is the configured free-plan limit and the API applies it, but this truthiness check suppresses the upgrade banner. Check for null/undefined so zero-day plans see why their log is empty.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/web/components/pages/OrganisationAuditLogPage.tsx, line 81:

<comment>`0` is the configured free-plan limit and the API applies it, but this truthiness check suppresses the upgrade banner. Check for `null`/`undefined` so zero-day plans see why their log is empty.</comment>

<file context>
@@ -0,0 +1,133 @@
+      {isAdminChecked && !isAdmin && <AuditLogNoAccess />}
+      {isAdmin && (
+        <div className='d-flex flex-column gap-3'>
+          {!!auditLimitDays && (
+            <PlanBasedBanner
+              force
</file context>
Fix with cubic


const isFirstLoad = isLoading && !items

if (!isFirstLoad && !items?.length) {

@cubic-dev-ai cubic-dev-ai Bot Nov 13, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: A refetch with a previously empty result returns the empty state while the request is still loading, so changing filters can briefly show “No changes match” before new results arrive. Gate the empty state on !isLoading and render loading rows when an empty result is being fetched.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/web/components/audit-log/AuditLogList/AuditLogList.tsx, line 39:

<comment>A refetch with a previously empty result returns the empty state while the request is still loading, so changing filters can briefly show “No changes match” before new results arrive. Gate the empty state on `!isLoading` and render loading rows when an empty result is being fetched.</comment>

<file context>
@@ -0,0 +1,80 @@
+
+  const isFirstLoad = isLoading && !items
+
+  if (!isFirstLoad && !items?.length) {
+    return (
+      <AuditLogListEmpty
</file context>
Fix with cubic

'code' in error.data
? error.data.code
: undefined
if (error.status === 503 && code === 'statement_timeout') return 'timeout'

@cubic-dev-ai cubic-dev-ai Bot Nov 13, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The audit endpoint does not translate query timeouts into a 503 response with data.code = 'statement_timeout', so timed-out searches fall through to the generic error message. Classify the endpoint’s actual timeout response or add that mapping on the API side.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At frontend/web/components/audit-log/auditLogError.ts, line 19:

<comment>The audit endpoint does not translate query timeouts into a `503` response with `data.code = 'statement_timeout'`, so timed-out searches fall through to the generic error message. Classify the endpoint’s actual timeout response or add that mapping on the API side.</comment>

<file context>
@@ -0,0 +1,21 @@
+    'code' in error.data
+      ? error.data.code
+      : undefined
+  if (error.status === 503 && code === 'statement_timeout') return 'timeout'
+  return 'unknown'
+}
</file context>
Fix with cubic

This branch was successfully deployed

2 active deployments
Preview – flagsmith-frontend-staging — d6908d27 Deployed Nov 13, 2026 by vercel[bot]
Preview – flagsmith-frontend-preview — d6908d27 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Organisation audit logs tab

3 participants