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

[Bug] Failed to parse metadata: FormatException: Unexpected end of input (at character 1) #1047

Open
owenyang0 opened this issue Dec 5, 2024 · 5 comments
Assignees

Comments

@owenyang0
Copy link
Contributor

Bug Description

I'm experiencing issues with document synchronization between my iOS device and AppFlowy on my Mac, and the opposite is also true.
Even when I attempt to rename an existing document on my iOS device, the title turns to be "Untitled".

Upon checking the PC logs, I encountered

{"msg":"[Flutter]: Failed to parse metadata: FormatException: Unexpected end of input (at character 1)\n\n^\n","time":"12-05 20:03:49","target":"dart_ffi"}
{"msg":"[Flutter]: Failed to parse metadata: FormatException: Unexpected end of input (at character 1)\n\n^\n","time":"12-05 20:03:51","target":"dart_ffi"}

and a message like

{"msg":"request_id: \"454386038f576d5794deab87a96056a9\"","time":"12-05 20:04:02","target":"client_api::http"}
{"msg":"1c97346f-d893-47da-8a45-22d0c77801e0 expect message id:102, but receive:103","time":"12-05 20:04:02","target":"client_api::collab_sync::collab_sink"}
{"msg":"request_id: \"bd8e17c25af438f62e9e7c70cb4289ec\"","time":"12-05 20:04:10","target":"client_api::http"}
{"msg":"1c97346f-d893-47da-8a45-22d0c77801e0 expect message id:102, but receive:103","time":"12-05 20:04:10","target":"client_api::collab_sync::collab_sink"}
{"msg":"request_id: \"30689466792a0f57c32cc32a13cdc1df\"","time":"12-05 20:04:26","target":"client_api::http"}
{"msg":"1c97346f-d893-47da-8a45-22d0c77801e0 expect message id:102, but receive:103","time":"12-05 20:04:26","target":"client_api::collab_sync::collab_sink"}
{"msg":"request_id: \"685cc381ed477bcd76d7fbe92dba615c\"","time":"12-05 20:04:34","target":"client_api::http"}

Despite uninstalling and reinstalling AppFlowy, the problem persists.

Interestingly, this issue is unique to my specific workspace, and the document content can sync across devices. When I switch to a different workspace, everything works as it should.

I'm concerned that my data might be corrupted. What should I do to rectify this?

How to Reproduce

Unfortunately, I'm at a loss.

Expected Behavior

Multiple devices can synchronize in real time

Operating System

macOS and iOS

AppFlowy Version(s)

0.7.5

Screenshots

iPhone
image

Mac
image

Additional Context

I'm using self-hosted version 0.7.27

Full PC logs

2024-12-05.log

@khorshuheng
Copy link
Collaborator

Does this only happen for all documents within the specific workspace, or just one of the document?

@khorshuheng
Copy link
Collaborator

From the log and screenshot, seems like the document that corresponds to the workspace folder has some missing updates.

@owenyang0
Copy link
Contributor Author

owenyang0 commented Dec 6, 2024

Hi @khorshuheng

This issue affects all new documents within the specific workspace. I can't create a new document without encountering sync issues; the new document doesn't appear on other devices.

However, content synchronization functions as expected. Despite attempts to clear the cache and reinstall the app, the problem persists.

I'm currently using a new workspace, hoping the issue won't reoccur.

Is there a workaround to resolve this? Any help would be greatly appreciated.

@khorshuheng khorshuheng self-assigned this Dec 6, 2024
@appflowy appflowy transferred this issue from AppFlowy-IO/AppFlowy Dec 6, 2024
@khorshuheng
Copy link
Collaborator

Yes, the problem lies with the workspace folder data itself, not the documents that are under the folder. When new documents are created, or renamed, it is this workspace folder that is modified, not individual document. That's why content synchronization works but operations such as renaming and adding new document doesn't get synced.

When changes are made to the workspace folder, updates are sent to the server via web socket. While it's not common, we are aware, that under some circumstances, the application does not send every update to the server, which resulted in errors like:

expect message id:102, but receive:103"

Assuming that this log is found on the Mac, then the missing updates likely comes from the iOS device. We do perform a full sync periodically, that detect if there are missing updates from the client that has not been sent. Currently, we do not have a convenient way for a user to trigger this on demand. What you can do in the meanwhile, is to run both MacOS and iOS side by side, Then on the IOS, navigate to another workspace, then come back to the workspace with issue again, and wait for a while.

Let us know if this helps with resolving the issue. If not, you can join our discord channel, and we can communicate directly to get more details on the problem.

@owenyang0
Copy link
Contributor Author

Thank you for sharing the details about the workspace issue.

I tried your suggestion, but it did not work. I then logged out and uninstalled the applications from both devices before logging back in. It appeared like a full sync to me, with all document names being identical on both sides.

However, after renaming one document on iOS, the title on the PC changed to "Untitled", and I received an error message like this:

expect message id:12, but receive:31

For further discussion, I will post this thread on Discord. If necessary, I can provide additional information and logs.

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

2 participants