Oh oh.
CBL considers this an error, which I believe is technically correct. The first rev of a doc is always 1, so it makes no sense to have a revpos of 0.
Specifically, this little block of code in CBLDatabase+Attachments does the check:
- (NSDictionary*) attachmentsFromRevision: (CBL_Revision*)rev
status: (CBLStatus*)outStatus
...
id revPosObj = attachInfo[@"revpos"];
if (revPosObj) {
int revPos = [$castIf(NSNumber, revPosObj) intValue];
if (revPos <= 0) {
*outStatus = kCBLStatusBadAttachment;
return nil;
}
}
So now my iOS 7 App Store app is unable to get any updates.
I can't see any solution other than deleting all attachments (nearly 700!) and re-uploading them all, as this is the only way to reset the revpos.
I considered changing the code above and doing an app update, but that would mean a probably 7 day wait for approval, and I need to fix this now.
Anyone else out there got any other ideas?
Thx,
- AJ
ps : I'll be contacting Cloudant to see if they can recover the older version of my DB.