mikebridge opened a new pull request, #45055:
URL: https://github.com/apache/superset/pull/45055

   ### SUMMARY
   
   Completes the follow-up deferred in #42539. `cacheWrapper` cached a rejected 
promise indefinitely at its key, so a transient failure on a cached GET (for 
example a one-off 422 or a network error) was replayed to every later caller 
instead of being retried. This change makes the wrapper evict a rejected 
promise centrally.
   
   - A rejection observer on the cached value deletes the entry only when the 
rejected promise is still the one stored at the key, so a late failure from an 
older request cannot delete a newer replacement.
   - The original promise is returned unchanged, so concurrent requests still 
share the in-flight promise and fulfilled values stay cached.
   - The three per-caller rejection workarounds that this replaces are removed 
from `useDisplayControlDatasource.ts`, `hooks/apiResources/datasets.ts`, and 
`semanticViewStructure.ts`. Dataset cache clearing after successful saves is a 
separate invalidation and is unchanged.
   - A later user-triggered action on the same key now issues a new request. No 
automatic retry loop is introduced.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (retry behavior only, no visual change).
   
   ### TESTING INSTRUCTIONS
   
   Run the focused Jest suites for `cacheWrapper`, `cachedSupersetGet`, 
`semanticViewStructure`, `useDisplayControlDatasource`, and dataset drill 
metadata. They cover a generic reject-then-resolve retry, in-flight sharing, a 
late failure versus a replacement entry, a real `cachedSupersetGet` GET, and 
retry/recovery in each of the three former workaround callers.
   
   The generic retry test fails on master (the second call rejects with the 
original error), and the caller tests fail when the workarounds are removed 
without the central fix.
   
   Verification limits: these are mocked frontend tests, and no live failing 
endpoint was exercised. The native frontend type-check hook could not be 
completed locally because the monorepo package declarations were not built, so 
CI is the authority for type checking. All other changed-file pre-commit hooks 
passed.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue
   - [ ] Required feature flags
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to