Exercise 3: Pre-Existing Items Losing Access — Possible Solution ==================================================================== WHY OLDER ITEMS BECOME INACCESSIBLE ------------------------------ Every item created while working through Chapters 2 through 10 was written before userId existed as a concept in this app at all, so those documents simply have no userId field. Once the new rules require request.auth.uid == resource.data.userId to read, update, or delete a document, that comparison can never succeed for a document with no userId value to compare against - it fails the check regardless of who is signed in, making those older items permanently inaccessible through the app's normal rules-governed access. THE CONNECTION TO CHAPTER 8 ------------------------------ Chapter 8 already taught this exact underlying problem when nameLower was added to the add-item flow after real items already existed: documents created before that change had no nameLower field, so search queries built against it silently failed to find them. The fix there was a one-time backfill script reading every existing document and writing the missing field. The userId situation in this chapter is the identical problem - a new field the application now depends on, added after real data already exists - just applied to ownership/access rather than search. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains that the ownership check can never succeed against a document missing userId entirely, and correctly identifies this as the same underlying schema-on-read backfill problem Chapter 8 already demonstrated with nameLower, rather than treating it as an unrelated new issue.