kiwiz / gkeepapi

An unofficial client for the Google Keep API.
MIT License
1.53k stars 114 forks source link

Is `serverId` a primary key of a note? #116

Closed 4l1fe closed 2 years ago

4l1fe commented 2 years ago

Hey. I'm coding some logic and saving data into a local database and want to reuse any unique identifier. For this purpose, the attribute serverId seems what i need. But i'm not sure if it's a primary key of a file/note/data record on the Keep server side.

Do you have any thoughts on it?

kiwiz commented 2 years ago

serverId should be authoritative, so you can use it as a PKID.

4l1fe commented 2 years ago

Maybe i'm wrong but i have a doubt a note keeps its serverId unchangeable. I made an experiment of comparing with DeepDiff two states old and current, which the Keep class in after synching, ones. And the DeepDiff's difference showed that some notes serverId is changed.

I don't know how to check such a case to discard the doubt.

Have you had a similar observation?

4l1fe commented 2 years ago

Maybe i'm wrong but i have a doubt a note keeps its serverId unchangeable. I made an experiment of comparing with DeepDiff two states old and current, which the Keep class in after synching, ones. And the DeepDiff's difference showed that some notes serverId is changed.

I don't know how to check such a case to discard the doubt.

Have you had a similar observation?

Seems the assumption that serverId value is dynamic is wrong as i didn't order the states elements during comparing and got an incorrect result.