Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration with attachments removes attachment mime types #3460

Closed
swnf opened this issue Oct 23, 2021 · 0 comments
Closed

Migration with attachments removes attachment mime types #3460

swnf opened this issue Oct 23, 2021 · 0 comments

Comments

@swnf
Copy link
Contributor

swnf commented Oct 23, 2021

Case

Bug

Issue

I'm trying to migrate a collection which contains attachments. Even though I don't change _attachments at all, the content_type is lost after the migration (which causes different errors). The migration itself is successful.

It looks like the data migrator calls bulkAddRevisions here with documents which look like this:

{
    ....,
    _attachments: {
        foo: {
            data: Blob,
            type: 'text/plain'
        }
    }
}

This looks more like RxDocumentWriteData than RxDocumentData (which bulkAddRevisions is supposed to take as an argument). If I replace pouchSwapPrimaryToId with rxDocumentDataToPouchDocumentData in bulkAddRevisions everything seems to work.

Info

  • RxDB Version: 10.2.1
  • Environment: Browser
  • Adapter: IndexedDB
  • Stack: Angular

Code

#3461

@swnf swnf mentioned this issue Oct 23, 2021
1 task
@swnf swnf changed the title Migration with attachments fails Migration with attachments removes attachment mime types Oct 23, 2021
@pubkey pubkey closed this as completed in 867016a Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant