ZeroNetX / ZeroNet

ZeroNetX - Decentralized websites using Bitcoin crypto and BitTorrent network
https://zeronet.dev
Other
212 stars 32 forks source link

Scribe doesn't add new posts and cannot edit existing ones #190

Closed qomhmd closed 1 year ago

qomhmd commented 1 year ago

Edited: I reduced the number of includes by base64 encoding and embedding most of the pictures into data.json. But the other problems persist.


I should mention that I have added posts to data/content.json manually.

Nothing is shown after I click on the "add a new post" button but in browser console:

[ZeroBlog] Unknown command

When I edit an existing post:

Connection with UiServer Websocket was lost. Reconnecting...

Meanwhile, my browser console says:

{error: 'Too many files in content.json'}

Also, after some lines about loading image file:

Uncaught TypeError: this.requestSite(...).then is not a function at CorsRequester.requestSiteAndContentJson (all.js?lang=en:2883:47) at CorsRequester.requestSiteAndContentJson (all.js?lang=en:2748:59) at CorsResolver.runStatusCheck (all.js?lang=en:3002:28) at CorsResolver.handleImageProgress (all.js?lang=en:3055:16) at CorsResolver.onImagesLoaded_Progress (all.js?lang=en:3112:27) at CorsResolver.onImagesLoaded_Progress (all.js?lang=en:2928:59) at ImagesLoaded. (all.js?lang=en:3138:24) at proto.emitEvent (all.js?lang=en:326:14) at ImagesLoaded.progress (all.js?lang=en:571:8) at all.js?lang=en:557:13

canewsin commented 1 year ago

having too many includes is only way you can get this error.

https://github.com/ZeroNetX/ZeroNet/blob/d5703541be8c463bb027b99aefc92130d88b8cc8/src/Ui/UiWebsocket.py#L1062-L1065

qomhmd commented 1 year ago

Dear @canewsin

having too many includes is only way you can get this error.

I removed almost all files from the directory and the data.json, by base64 encoding and embedding; however, other problems and errors persist.

slrslr commented 1 year ago

@qomhmd IMBW but one can loose track of which errors do you mean, that is why it is handy to keep these mentioned in original posts(OP)/first post of this issue for example or link to a log file that you uploaded (i am usually using expired paste at https://bin.disroot.org/) where i exclude unrelated lines so developer spend less time. Also your post is missing ZNX version number and operating system, python version. BTW. after changes in site file/s are signed, i may restart ZN.

qomhmd commented 1 year ago

@slrslr Thank you for your recommendation. I don't know yet whether the log file encompasses any errors, or I am supposed to check the browser console also. Nothing resolved after restarting ZN. Now is it better to edit the OP or start a new issue?

canewsin commented 1 year ago

@qomhmd try checking next_post_id in data.json, sometimes this causes issue to not add new post.

qomhmd commented 1 year ago

@qomhmd try checking next_post_id in data.json, sometimes this causes issue to not add new post.

The id was correct beforehand; my last post_id is 449 and the next_post_id is 500.

May the problem be related to the discrepency of post_ids and date_published between posts? For instance there are:

This log is selected from the original log file while ZeroNet was working in the offline mode, for a period following:

  1. pressing "New post" button whereas nothing happens (except a browser console log of [ZeroBlog] Unknown command).
  2. Then editing a post and trying to sign & publish, but ZN is disconnected and reconnected.
qomhmd commented 1 year ago

It seems that the culprit is adding images to the posts using markdown which would prevent us from adding new posts; if one deletes the related content, the functionality returns!