You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typed PC/SC errors everywhere (#144). The low-level Context, Reader and Card now throw PCSCError subclasses carrying err.code, the same as Devices, so the README's instanceof checks work at every level. The new toPCSCError() turns any error into this typed form.
Card reset works when a reset offering T=0 and T=1 reports the card unresponsive (#145). Some reader and card combinations (an SCR35xx with a T=0-only card, for one) report the card unresponsive when a reset offers T=1 as well as T=0. Previously the reset failed and the card stopped answering until it was reconnected. Cards from Devices (or wrapCard()) now retry once with the protocol the card is already using, if the caller offered it. If the retry fails too, the original error is thrown with the retry's error as its cause.
Reader and Card are exported with real types instead of unknown (#129, fixes #128).
Bug Fixes
Reader monitor reliability (#130). Fixes four problems found in a Windows deployment where only about one card tap in ten registered: plug-and-play events could be lost, the monitor didn't recover from a dead PC/SC context (for example after the service restarted), error events had no error code, and the native monitor could keep a dangling pointer to a reader's name.
Missed card-inserted events during plug-and-play churn (#138). When the reader list lagged behind the monitor, a card insertion was silently dropped, so Devices now retries the lookup briefly. Separately, a single unhandled error (an error event with no listener) used to stop all event processing for good, even across stop()/start(). It no longer does.
Monitor lifecycle races (#139). Calling stop() then start() in the same tick could kill the new monitor thread.
A GET RESPONSE chain that makes no progress now stops, and chains are bounded by bytes.
Correcting Le on a Case 3 command now appends Le instead of overwriting the last data byte.
Handle lifetimes (#144). Readers and cards now share their PC/SC context handle, so garbage collection can't close the context while they're still in use.
Devices.start() (#144). If it fails part-way, it now rolls back so you can call it again.
A clearer error when the native addon is missing, for example with bun or a bundler (#135).