If you have an anonymous, unrevealed collection (or, quite likely, a collection that is only one of those) and someone posts a work to said collection, the work and its creator may still be visible to all who encounter said work.
These steps will not always reproduce the bug, but here is the process:
Browse > Collections > New Collection
Fill in required information
Check both “This collection is unrevealed” and “This collection is anonymous”
Follow the “Post to Collection” link
Fill in required information (the collection info will already be filled in because you used the “Post to Collection” link)
Post Without Preview
This is a fascinating situation where the Work is incorrect (), but the CollectionItem is correct ( ):
Please note that theand IDs have been changed to and some work fields ( , , , , , ) removed for privacy, as they are not relevant.
We confirmed that this work -- and at least one other work affected by this issue -- belonged only to one anonymous, unrevealed collection.
We note that theand were created at the exact same time ( ), although this is not in itself unusual -- it happens on works that are properly marked unrevealed and anonymous as well.
We suspect a race condition. 😭
is one of the few callbacks we have that tries to read data that was just written in the previous commit. Because it's an callback, not an , the database queries to look up (in , which is called by ) occur outside of the transaction, which in theory would allow them them be routed to the read-only SQL servers, which have some chance of lagging behind the master SQL server by a transaction or two. (h/t ticking instant for the discovery and explanation.)
Because this cannot be reproduced at will, it is unlikely the fix can be tested. All we can do is take several shots at posting to an unrevealed, anonymous collection to confirm the correct behavior still happens and watch for any new reports of this bug after the fix is deployed.