Repository navigation
fix(react-keytips): handle KEYTIP_REMOVED/UPDATED in useKeytipsManager - #672
Ray Winkelman (rwinkelman) wants to merge 4 commits into
Conversation
Paul Mardling (PaulGMardling)
left a comment
There was a problem hiding this comment.
This looks like a focused fix that keeps the manager’s registry consistent with update and removal events.
Could we also add a useKeytipsManager regression test that registers a keytip, updates it and checks the new properties through getKeytips(), then unregisters it and checks that the entry is gone?
That would directly cover the stale-registry behavior this fixes.
Register a keytip, update it, and unregister it through useKeytipsManager so a stale registry cannot come back unnoticed.
|
Added
|
Paul Mardling (PaulGMardling)
left a comment
There was a problem hiding this comment.
Looks good to me. The new test covers the registry update and removal behavior we discussed. Thanks for adding it!
|
Victor Genaev (@mainframev), the fix looks good, can you please double check and merge if all good ? |
| @@ -0,0 +1,7 @@ | |||
| { | |||
| "type": "patch", | |||
| "comment": "fix(react-keytips): handle KEYTIP_REMOVED/UPDATED in useKeytipsManager", | |||
There was a problem hiding this comment.
nit
| "comment": "fix(react-keytips): handle KEYTIP_REMOVED/UPDATED in useKeytipsManager", | |
| "comment": "fix: handle KEYTIP_REMOVED/UPDATED in useKeytipsManager", |
Summary
`useKeytipsManager` only subscribed to `KEYTIP_ADDED`, so the registry grew unbounded. Subscribe to `KEYTIP_UPDATED` and `KEYTIP_REMOVED` as `useKeytips` already does.
Fixes #671
Test plan