Closed PGoski closed 2 years ago
Tested again, B receive data after node restart which is better than before but not solves the problem fully.
after more debugging I've found that there is a race condition in the original code behavior. Looks like it should be fixed somewhere else.
evidence that original code is working (sometimes):
2022-03-22T17:07:06.198Z DEBUG baseorbitdb/orbitdb.go:980 connecting to QmYCQorVqw67DUHEAmVv26K9wv5V8QrySoi89k6fUp2gxP 2022/03/22 17:07:06 end replicate event /orbitdb/bafyreic27uz6j5vaxk6g5q4f53ig3vw7cwt3zklnj74pt7ykiz2las6v4q/profile-metadata 2022-03-22T17:07:07.198Z DEBUG baseorbitdb/orbitdb.go:985 connected to QmYCQorVqw67DUHEAmVv26K9wv5V8QrySoi89k6fUp2gxP 2022-03-22T17:07:07.199Z DEBUG baseorbitdb/orbitdb.go:985 connected to QmPPG6NETmEwiSQooqMyE5GmmHZgzhxENzebaJgRhZHw3H 2022-03-22T17:07:07.199Z DEBUG baseorbitdb/orbitdb.go:1032 sending heads {"addr": "/orbitdb/bafyreigvpjkyrhfvyfwchmyez3unhaum54conaqxhgfd53aelinz2ghrbm/9902ef6b-28c6-4daf-8f0e-ff848c789717", "heads": 0, "peer": "QmYCQorVqw67DUHEAmVv26K9wv5V8QrySoi89k6fUp2gxP"} 2022-03-22T17:07:07.199Z DEBUG baseorbitdb/orbitdb.go:1032 sending heads {"addr": "/orbitdb/bafyreigvpjkyrhfvyfwchmyez3unhaum54conaqxhgfd53aelinz2ghrbm/9902ef6b-28c6-4daf-8f0e-ff848c789717", "heads": 0, "peer": "QmPPG6NETmEwiSQooqMyE5GmmHZgzhxENzebaJgRhZHw3H"} 2022-03-22T17:07:08.050Z DEBUG baseorbitdb/events_handler.go:33 QmUd9hASvtA76gS2mNZ8WAimnCAFyJps25iktkk9wgXGXq: Received 1 heads for '/orbitdb/bafyreigvpjkyrhfvyfwchmyez3unhaum54conaqxhgfd53aelinz2ghrbm/9902ef6b-28c6-4daf-8f0e-ff848c789717' from QmPPG6NETmEwiSQooqMyE5GmmHZgzhxENzebaJgRhZHw3H:
Scenario:
Problem reproduction:
After my fix B will receive data even if A went offline