Oh oh.
I recently had a Cloudant DB migrated from one server to another
(see https://groups.google.com/forum/#!topic/mobile-couchbase/ZybaUUPKNmM
for some background), and all my attachments now have a revpos value of 0.
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.
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/ce3b21de-be88-405e-9913-6dd0a201160b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.