thecommons-urbit / blog

MIT License
12 stars 5 forks source link

some times I'm stuck not being able to edit or save a theme #13

Open m-rio opened 6 months ago

m-rio commented 6 months ago

I'm finding it hard to identify what I did to report here but I have noticed that some times after I saved new edits to a theme, when I try to edit again I just can't seem to save the new changes. I also tried creating new theme after noticing this and it also fails to save the new theme. I noticed similar behaviours while editing published posts.

bonbud-macryg commented 6 months ago

Could you paste in the output of running +vats %base and +vats %blog in your dojo?

m-rio commented 6 months ago

just happened and I captured this:

peek bad result
/app/blog/hoon:<[302 12].[302 39]>
/app/blog/hoon:<[302 9].[302 40]>
/app/blog/hoon:<[301 9].[302 40]>
/app/blog/hoon:<[300 9].[302 40]>
/app/blog/hoon:<[299 9].[302 40]>
/app/blog/hoon:<[274 3].[391 31]>
/app/blog/hoon:<[272 3].[391 31]>
/sys/vane/gall/hoon:<[1.725 26].[1.725 60]>
> +vats %blog
%blog
  /sys/kelvin:           [%zuse 411]
  %cz hash ends in:      th6jm
  app status:            running
  source ship:           ~dister-bonbud-macryg
  pending updates:       ~
::
> +vats %base
%base
  /sys/kelvin:           [%zuse 411]
  %cz hash ends in:      b4l49
  app status:            running
  source ship:           ~binzod
  pending updates:       ~
::
m-rio commented 6 months ago

@bonbud-macryg just happened again... I can't save anything. This is what I get when I try to save a new draft:

image

Every time I get stuck the only way is for me to nuke/uninstall %blog and install/revive it from zero. then I past the content of the theme and existing posts to get this going again

bonbud-macryg commented 6 months ago

Do you see that session.js error at the top of the image every time this happens? And once this error has happened, are you able to refresh your urbit apps in another tab and send pokes to them without issue?

Also curious if this just happens when you paste in your theme? (You could try pasting in and editing your posts without touching the themes at all.) If so, would appreciate a pastebin of the CSS you're pasting in there.

bonbud-macryg commented 6 months ago

Also, what's your hosting setup for this ship?

m-rio commented 6 months ago

Also, what's your hosting setup for this ship?

I'm selfhosted on a VPS

pastebin of css: https://pastebin.com/65kVTcMS

So, this morning it happened again - couldn't save/edit published/draft posts or themes. So I used landscape to uninstall then used get apps to install again (I also ran |revive %blog while I waited for installation). And the first load already shows a unexpected token '<' error in console. what you see is my %blog instance on first load. unexpectedly it found the previous content and it seems I can edit/create files again.

image

m-rio commented 6 months ago

@bonbud-macryg I just saw the session.js error again. I can't make changes to any files on %blog now. I went to %wiki and created a new doc, and it works fine... how can I test pokes?

[update] This time I didn't do anything on urbit. I just closed everything and restarted my computer and on coming back I don't see the session.js error anymore and can continue to work on my pages/themes... I guess close the browser helped...?

ashelkovnykov commented 6 months ago

@m-rio Chromium-based browsers tend to keep their Urbit app JS caches around for a very long time for some reason. Are you using Chrome / Brave (Vivaldi, Edge...)? It's possible that your frontend was out of date but the backend wasn't, so there were minor peek/poke errors going on: the frontend either serializing incorrect input or deserializing incorrect output.

m-rio commented 6 months ago

@ashelkovnykov unfortunately I'm lacking the knowledge to troubleshoot beyond what I see in the console. Right now I've isolated the issue to: whenever I see the error from session.js (which seems to be related to rocket-loader.min.js some kind of dependency) I know I won't be able to continue to work on %blog. I need to close the tab/window/browser and open %blog again... working in incognito mode seems to help but if I leave %leave opened for a while without doing anything the session.js starts happening (at least now I know I don't need to keep |nuking |reviving to continue to work)

bonbud-macryg commented 6 months ago

Rocket Loader isn't a dependency in Common Blog, quick search says it's a Cloudflare thing which is why I asked about your hosting setup. Could try disabling it if you can? https://developers.cloudflare.com/speed/optimization/content/rocket-loader/enable/

m-rio commented 6 months ago

@bonbud-macryg thanks! I disabled it now. I inspected common blog for session.js or rocket-loader and couldn't find it so I thought it was from somewhere else on my ship. thanks for finding it! let's see how it goes now

m-rio commented 6 months ago

@bonbud-macryg after making and publishing a single edit (and I have disabled rocket loader) I now get the session.js error and am stuck. If I close the tab and reopen it fixes it. I'm on arc browser (chrome based) and I'm not in incognito mode. Is this something related to how urbit keeps sessions alive?

image

m-rio commented 6 months ago

googling around, it seems that session.js is also something related to cloudflare... sigh... i use it to manage dns...

bonbud-macryg commented 6 months ago

The error is pointing to resume:8, could it be because you're putting HTML in the composer? Try just using Markdown.

it seems that session.js is also something related to cloudflare...

FWIW Urbit also a has session.js.

m-rio commented 6 months ago

image

I added html because it worked (except when I couldn't save it(!)) it renders fine in preview and whenever I'm able to publish it. I can see a script tag with session.js indeed

bonbud-macryg commented 6 months ago

@m-rio Thanks for the screenshot. I was able to reproduce this on a Tlon-hosted ship by editing and publishing and editing a published post a few times, had to publish 3-5 times to make it happen. I was then able to continue re-editing the post by closing the tab and going back Common Blog through the Landscape menu. I can't reproduce it again just now.

bonbud-macryg commented 6 months ago

In my case the post I was editing and publishing over and over was just one line of plain text.