android_catalogue1-9 Exercise 1: Testing the Duplicate Warning =============================================================== (a) Add "Dune" / "Frank Herbert" when "dune" / "frank herbert" exists: Press Save: the dialog "You may already own this" appears: "You already have 1 item called "Dune" by the same creator. Save another copy anyway?" Nothing has been saved yet. (COLLATE NOCASE ignores case for ASCII letters, so the different capitals do not matter.) (b) Edit that existing item and Save unchanged: NO warning. The query excludes the item's own id (id != :excludeId), so it never counts itself. If you see a warning here, excludeId is not the form's itemId (for a new item itemId is 0, which matches no real row, so the same query is correct for both cases). (c) "Dune" by "Someone Else": no warning; both title AND creator must match. (d) "Save anyway" in (a): the dialog closes, the item is saved, the form closes, and the list now has two Dune items. "Go back" instead returns to the form with everything still filled in. Common problems: - The warning shows but "Save anyway" does nothing: onSaveAnyway is not passed through FormScreen to viewModel.saveAnyway(onDone). - The warning reappears after rotating the phone: duplicateCount is in the view model state, so it correctly survives rotation; that is intended, the question is still unanswered. - Trailing spaces: "Dune " and "Dune" count as duplicates only because the repository trims first.