Skip to content

withdrawn: Subject fallback for failed email Source previews - #6042

Closed
synoet wants to merge 3 commits into
mainfrom
synoet/unknown-thread-source-b73c
Closed

synoet wants to merge 3 commits into
mainfrom
synoet/unknown-thread-source-b73c

Conversation

@synoet

@synoet synoet commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

Withdrawn at review. The fallback made a failed getThread render as a healthy Source pill, which hides the failure it papers over (expired token cached as no_access, a missing access grant, or a stale thread id). The branch now reverts the fallback, so its net diff is zero. Close without merging.

The investigation notes stay useful:

  • Unknown thread is usePropertyEntityDisplay's label for a THREAD preview whose getThread failed. Sender, Recipients, and Subject never need the live thread, which is why only Source degraded.
  • fetchEmailPreviews collapses every getThread error (401 auth, 401 no-access, 404 gone, network) into no_access, and the preview query caches that result.
  • Datadog, last 30 days: 1094 of 1421 from_request_parts errors on email-service are jwt expired; 327 are real access denials. A transient token expiry during preview is cached and renders as Unknown thread until the cache drops.

Follow-up direction, tracked outside this PR: classify the failure (transient auth vs no access vs gone) instead of relabeling it, and stop caching transient failures as permanent no_access.

Verification

The revert restores main's behavior exactly: the three repro PDFs render as on main (owned thread resolves the subject, missing-thread and message-id docs show Unknown thread).

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 30, 2026 03:03
Imported attachments already store the email subject on the document.
Source still renders Unknown thread when getThread returns no_access.
This test locks the label we want before the fallback lands.

Co-authored-by: teo <synoet@users.noreply.github.com>
When getThread returns no_access, the Source pill used Unknown thread.
Imported attachments already store Subject on the same write. Use that
sibling string as the display name and keep Unknown thread when it is
missing.

Co-authored-by: teo <synoet@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a55d0612-87cb-4d8b-a939-3c8f7de0650c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2264e696-b43b-4d28-9b31-7b2e6e5a545c

📥 Commits

Reviewing files that changed from the base of the PR and between 1ce5a44 and 74b4b20.

📒 Files selected for processing (4)
  • apps/web/src/features/property/hooks/usePropertyEntityDisplay.tsx
  • apps/web/src/features/property/utils/index.ts
  • apps/web/src/features/property/utils/previewableEntityDisplayName.test.ts
  • apps/web/src/features/property/utils/previewableEntityDisplayName.ts

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


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Improved display names for property previews, including email thread subjects when available.
    • Added clearer fallback labels for inaccessible or unavailable previews.
  • Bug Fixes

    • Prevented property previews from showing generic or misleading names when a subject or preview name is available.
  • Tests

    • Added coverage for accessible previews, email thread subject fallbacks, unknown threads, and unsupported entity types.

Walkthrough

The change adds shared utilities for preview display names and THREAD subject fallbacks. The utilities handle loading previews, accessible preview names, fallback names, and unknown entity names. The property entity display hook reads optional properties context and uses the THREAD subject as a fallback. Tests cover accessible previews, subject fallbacks, unknown threads, and non-THREAD entities.

Merge Risk: 🔵 Low · up to 74b4b

The property panel now shows a stored thread Subject when the live thread preview is inaccessible, improving labels for imported email sources but potentially exposing copied thread metadata to users who cannot access the source thread. The change is mergeable with explicit owner confirmation that this disclosure matches the intended authorization policy.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title uses conventional commit format with the fix: prefix, clearly describes the main change, and is 59 characters long, which is under the 72-character limit.
Description check ✅ Passed The description directly explains the THREAD Subject fallback, scope, behavior, tests, tradeoffs, and verification details. It is related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

A fallback makes a failed getThread render as a healthy pill, so the
underlying failure (expired token cached as no_access, missing access
grant, or a stale thread id) stays invisible. Unknown thread returns
until the failure itself is classified and fixed.

Co-authored-by: teo <synoet@users.noreply.github.com>
@cursor cursor Bot changed the title fix(property): show Subject when email Source preview fails withdrawn: Subject fallback for failed email Source previews Aug 30, 2026
@synoet synoet closed this Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants