Repository navigation
Fix: bare store's absolute keys broke once the instance was wrapped; pin dol>=0.3.50 - #3
Conversation
#2 resolves every aget/asetitem key through wrapped_self's wrapper chain, but wrapped_self cannot tell a call reached through a wrapper from a direct call on the inner store. After wrap_kvs(bare, ...), bare.aget(abs_path) went through the wrapper's id_of_key again and read rootdir+rootdir+name. Keys the store already accepts are now taken verbatim. Also pin dol>=0.3.50, the first release with wrapped_self (an older installed dol made import fail). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Post-merge refute review: design concern (not changed in code). The J = wrap_kvs(AioFileBytesReader, id_of_key=lambda k: k + ".json", key_of_id=lambda i: i[:-5])
s = J(root, max_levels=0) # root holds both 'a' and 'a.json'
asyncio.run(s.aget(root + "a")) # b'PLAIN' (reads root/a); with #2 alone: root/a.jsonThis is the "absolute keys mapped to other absolute keys under the same rootdir" residual the PR body mentions. It covers every suffix/extension wrapper over absolute keys, which is probably more common than calling the bare instance after instance-wrapping it. From inside
Recommend (1). There are no fleet dependents, so the impact is limited. |
Post-merge refute review of #2.
Defect 1, regression. #2 resolves every
aget/asetitemkey throughinner_most_key(wrapped_self(self), k).wrapped_selfclimbs from the store to any live wrapper, and it cannot tell a call that came through the wrapper from a direct call on the inner store. So afterw = wrap_kvs(bare, id_of_key=..., key_of_id=...), the bare store's ownbare.aget(absolute_path)(which worked before #2) runs throughid_of_keya second time and raisesFileNotFoundError: <rootdir><rootdir>name.asetitemhas the same problem: it writes to the wrong path. Reproduced before fixing.Fix: a key the leaf store already accepts (
is_valid_key, i.e. a path under itsrootdir) is used verbatim. Relative keys never match an absolute rootdir pattern, so #2's RelPath fix is unaffected (its 4 tests still pass).Defect 2, packaging.
wrapped_selffirst shipped in dol 0.3.50, but the dependency was an unpinneddol. An environment with an older dol that upgrades aiofiledol getsImportErroratimport aiofiledol. Pinneddol>=0.3.50.Tests: two new tests (read and write through the bare store after an instance-wrap). Both fail on master and pass here. 6 tests + doctests pass.
Residual (not fixed): a wrapper that maps absolute keys to different absolute keys under the same rootdir would now be bypassed. I judged that much rarer than using the bare store directly.
Self-reviewed only (the dispatching run disallowed sub-agents).
🤖 Generated with Claude Code