Conversation
|
We ultimately went that route because it satisfy both:
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #570 +/- ##
==========================================
- Coverage 65.58% 65.29% -0.30%
==========================================
Files 206 203 -3
Lines 25587 25516 -71
==========================================
- Hits 16781 16660 -121
- Misses 7335 7372 +37
- Partials 1471 1484 +13 see 15 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Closing as stale - this has been open for 2 years with incomplete TODOs and no activity since Aug 2025. The approach here (context-embedded session registry with GC cleanup) seemed sound and was agreed upon in #567. If someone wants to pick this up, the design discussion in #567 may be still For now, we have the partial fix from #549 ( Happy to reopen (as a new PR) if there's renewed interest in completing this. |
This replaces #563 and #561.
TODO:
Questions:
comparableto ensure it doesn't panic the map, it might be interesting to enforce something likeinterface[S any]{ comparable; SessionBadge() S }because this would enforce at compile time that the session consumer is not mixing different session types together (which would not work).GetOrCreatereturn(S, error)instead ofS, bool?Passing errors can always be done efficiently through closures as
createdoes not leak, the important part is to not save in the map failed sessions.ContextWithSession(context.Context, ...Option)? We might want to add something like a request root in there.