Conflicted notes

Hi,

How about this build?

https://s3-ap-northeast-1.amazonaws.com/inkdrop-dist/tmp/inkdrop-3.22.0.x86_64-patch-2.rpm

Hope it works.

I will give it a shot tomorrow. Thanks for the quick bugfix.

Conflicts are back and all the side effects from the first patch still occur. Actually now I get conflicted notes all the time. At least it’s consistent in that manner. :sweat_smile: Hope you can narrow it down further.

Just recorded a demo where I created a new notebook and added some notes to demonstrate the conflicts, but much to my surprise everything worked fine. So conflicts only occur with “old” notes .

Thank you for trying the patch.
That’s weird…so you get conflicts only with all old notes, not particular notes? hmm…

Could you send me a debug log? You can enable debug log like so in console:

var debug = require('debug')
debug.enable('*')

You might have a different problem from Parker’s and maybe it’s potentially a PouchDB bug.
I guess removing your local db and performing a full-sync would solve the problem.

I did a full-sync and running the patch-2 version I haven’t had any issues with conflicted notes as of now. Seems you are right in that I was experiencing PouchDB problems. I will report back in case there are any more conflicts.

Good to hear that.

However I tried to repeat changing and saving a note 160 times but no conflicts happened.
Saving always finished immediately so I don’t know why it takes for a long time.
I suspect that the workaround won’t work for other people.
I need more information to narrow it down further.

Please send me debug logs

Anyone, please send me debug logs when you get unexpected conflict error.
You can enable debug log like so in console:

var debug = require('debug')
debug.enable('*')

If you mind to share your log here, please DM me your log, or you can mask the note body and title part.

I guess that db compaction solves it as well.

conflict: Document update conflict
    at /Applications/Inkdrop.app/Contents/Resources/electron.asar/renderer/api/remote.js:284:16
    at metaToPlainObject (/Applications/Inkdrop.app/Contents/Resources/electron.asar/renderer/api/remote.js:288:5)
    at metaToValue (/Applications/Inkdrop.app/Contents/Resources/electron.asar/renderer/api/remote.js:230:14)
    at metaToValue (/Applications/Inkdrop.app/Contents/Resources/electron.asar/renderer/api/remote.js:222:22)
    at EventEmitter.<anonymous> (/Applications/Inkdrop.app/Contents/Resources/electron.asar/renderer/api/remote.js:299:31)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:197:7)

◆conflict notes (現在conflict中)
https://community.inkdrop.info/note/d5e6a92b8373bd422b3a78055ce08915/note:F9EhT4qegj
https://community.inkdrop.info/note/d5e6a92b8373bd422b3a78055ce08915/note:BjUT9_0EVO

◆過去にconflictしていたノートのバージョン
7-b6d123b09f8bdb9aaaf236adeaea82a6
※conflictが起きたときに、conflictと記載されたものと、されてないものの、2パターンあったので、conflictと記載のものは消してしまいました。(日本語ですいません、、)

@anon35350940
Thank you for your report.

Do you always get the error when you saved those notes? (それらのノートを保存した時、毎回コンフリクトが発生しますか?)
Or does it happen randomly? (それとも確率的に発生しますか?)

If you are always getting it, please report a debug log as I described above.
(もし毎回コンフリクトが発生するのなら、デバッグログを報告してください。 Developer Toolsのコンソールを開いて以下を実行すると、以降ログが出力されるようになります:

var debug = require('debug')
debug.enable('*')

エラーが発生した前後のログを送ってください。)

32

すいません、期待するようなログが返ってこなったのですが、、デバッグが間違ってますでしょうか。。

@anon35350940

共有ノートのページではなくデスクトップアプリで実行して頂けますでしょうか。
もしこの操作が何を意味するのか分からないようでしたら、無理してやらなくても大丈夫です。
お手数をおかけしました。また、不具合でご不便をおかけして申し訳ありません。

ひとつ対処方法を思いついたのでパッチを当てたものを用意しました。
こちらを試してみて、エラーが解消されるか確認いただけますでしょうか?

https://s3-ap-northeast-1.amazonaws.com/inkdrop-dist/tmp/Inkdrop-3.22.0-Mac-patch-1.zip

よろしくお願いします!

I came up with an idea to avoid this problem, which is simple: Use pouchdb-upsert. It just attempts to put docs until it succeeds.

対処お疲れ様です。

このパッチが当てられた Windows 版はありますか?
恐らく、私の環境でも同じような状況が発生しています。
(すみません、debug ログなどは確認できていません)

こちらで確認する限り再現性100%ではないのですが、「ノート更新→他のノートに移動 (このタイミングで同期がかかる)」を素早く繰り返すことでコンフリクトが発生することが多いです。

@anon35350940

すみません、こっちを試してください!

https://s3-ap-northeast-1.amazonaws.com/inkdrop-dist/tmp/Inkdrop-3.22.0-Mac-patch-2.zip

@Yuko_Otawara

少々お待ちをー

ありがとうございます!

何度か試しましたが、今の所、以前のようなconflictは一度も起きなくなりました!

お手数をおかけしました。

1 Like

お待たせしました。こちらをお試しください:

https://s3-ap-northeast-1.amazonaws.com/inkdrop-dist/tmp/Inkdrop-3.22.0-Windows-patch-1.zip

ありがとうございます :rofl:

とりあえずメイン環境に入れてみたところ、同様の操作でコンフリクトが発生しなくなったように思います。

コンフリクトが発生しやすかった別端末(ディスクI/Oが遅く、ネットワーク低速な環境)でも試してみますー

1 Like

今 Inkdrop-3.22.0-Windows-patch-1 を試しています。

どうやら同期完了タイミング付近で編集中ノートでのキャレット位置が行頭に移動する不具合が発生しているようです。

ただ同期時に必ず発生するわけではなく、再現方法がまだ特定できていません。
ひとまずご一報まで。

Yukoさん

ありがとうございます。それはコンフリクトとは別の問題ですね。
また再現方法がわかりましたら、日本語板にてトピックを立てて頂けますと幸いです。

1 Like

Thank you everyone for working on this problem!
I finally found what was wrong and fixed it.
It was a state management and event handling issue.

I’m going to release it soon.

Cheers