_setState() doesn't await setAttachmentLastPageIndex(), so the setting sometimes won't be updated in the cache by the time we call getAttachmentLastPageIndex() below. Notifier event should work every time (and is a lot simpler).