Skip to content

fix localstorage access - #1435

Merged
priosshrsth merged 3 commits into
productionfrom
main
Aug 24, 2026
Merged

fix localstorage access#1435
priosshrsth merged 3 commits into
productionfrom
main

Conversation

@priosshrsth

Copy link
Copy Markdown
Collaborator

Changes

  • ...

Testing Criteria

  • Test Criterias (explain how you did testing for this PR mentioning all the cases you tested for) [Loom](video link going through the test criteria)

Notes

  • Dependencies on other PRs, any required changes in config/setup to test behaviour, or links to external documents, threads, etc -- if any of them are required

Impact & Surface Area of Change

  • An overview of components behaviour to be looked at for unintended breaks after the changes. This will make regression testing easier and efficient.

…1397)

deleteLabel passed `id: currentLabel?.id` straight into label.delete, so when
findFirst matched nothing Prisma got `{ id: undefined }` and threw
PrismaClientValidationError, failing the whole delete transaction. Return early
instead.
* OUT-4093 | Remove the localStorage→localForage assignee migration
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
tasks-app Ready Ready Preview Aug 24, 2026 11:04am

Request Review

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Deployment failed for project tasks-app with the following error:

Deploying Serverless Functions to multiple regions is restricted to the Pro and Enterprise plans.

Learn More: https://vercel.link/multiple-function-regions

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Greptile Summary

This PR makes the assignee cache tolerate unavailable browser storage and makes label deletion safely no-op when its mapping is absent.

  • Removes direct localStorage migration and Storage Access API calls from the assignee-cache path.
  • Falls back to network loading when localForage reads or writes fail.
  • Adds an existence guard before deleting label mappings.
  • Adds focused tests for unavailable storage and absent label mappings.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

Storage failures degrade to the existing authoritative network assignee fetch, while the label guard safely preserves idempotent cleanup when no active mapping exists.

Important Files Changed

Filename Overview
src/app/_cache/AssigneeCacheGetter.tsx Removes the legacy localStorage migration while retaining cache hydration through localForage.
src/app/_cache/forageStorage.ts Makes localForage access best-effort and avoids requesting browser storage access directly.
src/app/_cache/forageStorage.test.ts Covers denied cache reads and writes as well as ordinary cache misses.
src/app/api/label-mapping/label-mapping.service.ts Prevents deletion with an undefined identifier when no active label mapping exists.
src/app/api/label-mapping/label-mapping.service.test.ts Covers successful label deletion and idempotent handling of an already-absent mapping.

Reviews (1): Last reviewed commit: "OUT-4093 | Stop reading localStorage in ..." | Re-trigger Greptile

@priosshrsth
priosshrsth merged commit f007be3 into production Aug 24, 2026
1 of 2 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.

2 participants