benjypng / logseq-readwise-plugin

MIT License
66 stars 9 forks source link

Initial sync doesn't appear to allow importing from all sources #1

Closed MattHulse closed 2 years ago

MattHulse commented 2 years ago

image

It looks like only 100 sources will be imported. If I let the first sync complete will I be able to get the other sources on the next run?

I haven't let it complete yet because it seems like it is hanging at about the 50% mark.

MattHulse commented 2 years ago

It gets to about the same point every time I restart the sync and I see this exception in the console:

index.2e9780f7.js:formatted:12075 Uncaught (in promise) TypeError: Cannot read properties of null (reading '$cljs$core$IFn$_invoke$arity$1$')
    at $clojure$zip$node$$ (zip.cljs:64)
    at $frontend$modules$outliner$core$get_node_tree_topmost_last_loc$$ (core.cljs:355)
    at $frontend$modules$outliner$core$insert_nodes$$ (core.cljs:377)
    at $frontend$handler$editor$paste_block_vec_tree_at_target$$ (editor.cljs:2205)
    at $frontend$handler$editor$paste_block_tree_after_target$$ (editor.cljs:2267)
    at api.cljs:430
    at k (helpers.ts:141)
    at Ae.<anonymous> (LSPlugin.core.ts:186)
    at Ae.a.emit (index.js:181)
    at B.<anonymous> (LSPlugin.caller.ts:202)
syncReadwise @ index.2e9780f7.js:formatted:12075
async function (async)
syncReadwise @ index.2e9780f7.js:formatted:12069
tt @ index.2e9780f7.js:formatted:4137
lt @ index.2e9780f7.js:formatted:4155
(anonymous) @ index.2e9780f7.js:formatted:5136
Ur @ index.2e9780f7.js:formatted:5146
Br @ index.2e9780f7.js:formatted:5175
(anonymous) @ index.2e9780f7.js:formatted:5542
Ke @ index.2e9780f7.js:formatted:10277
(anonymous) @ index.2e9780f7.js:formatted:5274
Qr @ index.2e9780f7.js:formatted:5279
dn @ index.2e9780f7.js:formatted:4658
fn @ index.2e9780f7.js:formatted:4601
b @ index.2e9780f7.js:formatted:10707
aa @ index.2e9780f7.js:formatted:5808
Ve @ index.2e9780f7.js:formatted:10250
un @ index.2e9780f7.js:formatted:4586
benjypng commented 2 years ago

Thanks! Looks like it could be a use case I have not accounted for. Will provide a fix soon.

benjypng commented 2 years ago

@MattHulse Could you try the latest release? You can just click update from the marketplace. Because I don't have that many sources, could I get your help to see if it shows more than 100 sources?

Also, you may want to delete all the previously created files first. You can either find files ending with (Readwise) or just go by latest date.

nightscape commented 2 years ago

Hey @hkgnp, I just tried the new version and it says

You have too many sources! Please contact
the developer if you see this!
benjypng commented 2 years ago

@nightscape Wow! You have more than 1000 sources? If you don't mind, can you share how many sources do you have?

nightscape commented 2 years ago

I think it was ~1300. I don't know what the definition of a source is, is that one web page/book? I'm using Hypothes.is rather much, probably it's that.

benjypng commented 2 years ago

@nightscape I see! Okay you are the first person that I know who has 1,000 plus sources! I'm not familiar with Hypothesis too.

Yup 1 source accounts for 1 book/Twitter account, etc.

I'll work on a fix and release it soon 😃

MattHulse commented 2 years ago

I deleted all of the (Readwise) pages, updated to 2.2. I'm almost there, still like 8 sources short. Not sure why that is. Maybe I have some unsupported sources? Anyway, I hit refresh a few times, and I uninstalled/reinstalled the plugin just to clear out the settings to make sure nothing was hanging around from the last import.

image

Testing now to see if I get passed the 50% mark this time.

Thank you!

MattHulse commented 2 years ago

It gets to about the same point every time I restart the sync and I see this exception in the console:

index.2e9780f7.js:formatted:12075 Uncaught (in promise) TypeError: Cannot read properties of null (reading '$cljs$core$IFn$_invoke$arity$1$')
    at $clojure$zip$node$$ (zip.cljs:64)
    at $frontend$modules$outliner$core$get_node_tree_topmost_last_loc$$ (core.cljs:355)
    at $frontend$modules$outliner$core$insert_nodes$$ (core.cljs:377)
    at $frontend$handler$editor$paste_block_vec_tree_at_target$$ (editor.cljs:2205)
    at $frontend$handler$editor$paste_block_tree_after_target$$ (editor.cljs:2267)
    at api.cljs:430
    at k (helpers.ts:141)
    at Ae.<anonymous> (LSPlugin.core.ts:186)
    at Ae.a.emit (index.js:181)
    at B.<anonymous> (LSPlugin.caller.ts:202)
syncReadwise @ index.2e9780f7.js:formatted:12075
async function (async)
syncReadwise @ index.2e9780f7.js:formatted:12069
tt @ index.2e9780f7.js:formatted:4137
lt @ index.2e9780f7.js:formatted:4155
(anonymous) @ index.2e9780f7.js:formatted:5136
Ur @ index.2e9780f7.js:formatted:5146
Br @ index.2e9780f7.js:formatted:5175
(anonymous) @ index.2e9780f7.js:formatted:5542
Ke @ index.2e9780f7.js:formatted:10277
(anonymous) @ index.2e9780f7.js:formatted:5274
Qr @ index.2e9780f7.js:formatted:5279
dn @ index.2e9780f7.js:formatted:4658
fn @ index.2e9780f7.js:formatted:4601
b @ index.2e9780f7.js:formatted:10707
aa @ index.2e9780f7.js:formatted:5808
Ve @ index.2e9780f7.js:formatted:10250
un @ index.2e9780f7.js:formatted:4586

I've moved this exception to #2 since I don't think it is directly related to this issue.

benjypng commented 2 years ago

I think it was ~1300. I don't know what the definition of a source is, is that one web page/book? I'm using Hypothes.is rather much, probably it's that.

Hi @nightscape, I've added a fix to take into account scenarios involving more than 1,000 sources. Do have a look and see if it works now!

benjypng commented 2 years ago

It gets to about the same point every time I restart the sync and I see this exception in the console:

index.2e9780f7.js:formatted:12075 Uncaught (in promise) TypeError: Cannot read properties of null (reading '$cljs$core$IFn$_invoke$arity$1$')
    at $clojure$zip$node$$ (zip.cljs:64)
    at $frontend$modules$outliner$core$get_node_tree_topmost_last_loc$$ (core.cljs:355)
    at $frontend$modules$outliner$core$insert_nodes$$ (core.cljs:377)
    at $frontend$handler$editor$paste_block_vec_tree_at_target$$ (editor.cljs:2205)
    at $frontend$handler$editor$paste_block_tree_after_target$$ (editor.cljs:2267)
    at api.cljs:430
    at k (helpers.ts:141)
    at Ae.<anonymous> (LSPlugin.core.ts:186)
    at Ae.a.emit (index.js:181)
    at B.<anonymous> (LSPlugin.caller.ts:202)
syncReadwise @ index.2e9780f7.js:formatted:12075
async function (async)
syncReadwise @ index.2e9780f7.js:formatted:12069
tt @ index.2e9780f7.js:formatted:4137
lt @ index.2e9780f7.js:formatted:4155
(anonymous) @ index.2e9780f7.js:formatted:5136
Ur @ index.2e9780f7.js:formatted:5146
Br @ index.2e9780f7.js:formatted:5175
(anonymous) @ index.2e9780f7.js:formatted:5542
Ke @ index.2e9780f7.js:formatted:10277
(anonymous) @ index.2e9780f7.js:formatted:5274
Qr @ index.2e9780f7.js:formatted:5279
dn @ index.2e9780f7.js:formatted:4658
fn @ index.2e9780f7.js:formatted:4601
b @ index.2e9780f7.js:formatted:10707
aa @ index.2e9780f7.js:formatted:5808
Ve @ index.2e9780f7.js:formatted:10250
un @ index.2e9780f7.js:formatted:4586

I've moved this exception to #2 since I don't think it is directly related to this issue.

Thanks for sharing. Will reply in the other thread.

MattHulse commented 2 years ago

From my side, 2.2 resolves the sync sources issue (although I don't have as many as @nightscape): image

Looks great. Thanks.

benjypng commented 2 years ago

Thats good to hear! Much appreciated for trying it out!

Will close the ticket now but if there are issues, please reopen them again!