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

Dexie cloud add() operator sync bug #2103

Open
NitroRCr opened this issue Nov 29, 2024 · 0 comments
Open

Dexie cloud add() operator sync bug #2103

NitroRCr opened this issue Nov 29, 2024 · 0 comments

Comments

@NitroRCr
Copy link

Reproduction

There is a message object in the table messages
Its contents.0.items was initially an empty array

image

Execute this:

await db.messages.update('<messageId>', {
  'contents.0.items': add([item])
})

It works fine. The item has been added.

image

It also triggers sync at the same time, with payload:

image

Bug when receiving the response:

{
    "changes": [
        {
            "table": "messages",
            "muts": [
                {
                    "type": "update",
                    "keys": [
                        "1idrbrtjc4945r8qqo"
                    ],
                    "changeSpecs": [
                        {
                            "contents": [
                                {
                                    "text": "testttttttttttttttttt",
                                    "type": "user-message",
                                    "items": {
                                        "add": [
                                            {
                                                "id": "1idrc693r4945r9p5h",
                                                "type": "quote",
                                                "name": "用户消息引用 (16)",
                                                "contentText": "sttttttttttttttt"
                                            }
                                        ]
                                    }
                                }
                            ]
                        }
                    ],
                    "txid": "R4ROwJy+lHROKdmK50lbFw=="
                }
            ]
        }
    ],
    "rejections": [],
    // ...
}

The message changed again, and content.0.items became a object with property add:
image
This is not an expected behavior. I guess it is a bug of dexie-cloud

I'm using [email protected] and [email protected]

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