Safe Simple Forum

Hello !

As a way to learn coding Safe apps, I am putting together a basic forum that works on Safe.

This is mainly based on the comment plugins example by Maidsafe. I didn’t work fast enough so it doesn’t include editable comments yet, but this is on my TODO list !

I am currently working on adding ignore Ids, ignore lists, ban lists, and in a second phase I will try to make the messages as editable markup language, hopefully with image and media upload.

I hope you enjoy it, and that we can talk together on : safe://simple-forum :slight_smile:

EDIT : the above link was just updated due to alpha2 account put shortage and creating a fresh one.

I would be very happy to have your feedback and input.
The code is on : wrnice/safe_simple_forum: A basic forum that works on the Safe Network - NotABug.org: Free code hosting , please do post issues here if you feel so.

please note that this is really work in progress, and that it may very well send all your data to /dev/null or even worse.

32 Likes

Checking it out now :).

Hm. You’ve already put the code on github, and I just read your post very poorly. Awesome!

3 Likes

Bug report:

Got that with safe browser 0.6.0. Will try 0.7.0. FYI: was able to make a post, and then it kinda died. Possible that my post actually screwed something up?

3 Likes

I see your post there, not sure what went wrong, I’ll try to find it out, ty for reporting !!

3 Likes

Not sure what went wrong either, but changing to 0.7.0 fixed it. Nice work!

can confirm it doesnt work on 0.6.0
and that it works in 0.7.0

also there seems to be a problem with likes. I can like posts but when I refresh the page it drops to 0 again.,
edit: plus points for not being able to like as anonymous :smiley: (while anonymus I cant like at all, which I think is intended)

3 Likes

yes, I need to fix an issue where non-owner users are denied to update the likes. I suppose it is an issue with permissions/ authorisation

Awesome.

Keep up the good work.

4 Likes

I just posted a new version of the forum on : safe://simple-forum ( note the url change ).
Hopefully this version adresses the likes issue where non owners could not store their likes.

EDIT : nope … bug hunting continues
!
EDIT 2 : woot !! now with working likes :smiley: !

5 Likes

Hey I can see 3 topics, but when I click on one of them I get this one:

For

I’m on Win10/64

1 Like

I have seen this triggered from time to time, too, I didn’t find a pattern to reproduce it yet. Did you visit unlogged ? Or did you log in with the authenticator after entering the forum ? Or, open in a new tab ? these are reasons that come to my mind.

Some people also mentionned the 0.6.0 browser causes this, and didn’t have the issue with 0.7.0

Yes I’m pretty sure the new editable forums require 0.7.0. Works well for me, although I had one crash with a ‘couldn’t connect to the network’ error necessitating a browser restart. One question: what is it that causes the delay in the “initialising topics” process?

2 Likes

I had this one too - possibly some handles that I forgot to free here and there …

my understanding of the non-editable comments plugin code would make me say that this is simply a matter of waiting for the network to respond to the various requests that are made : initializing the app, authorizing, connecting, then fetching data for topics or replies, likes, etc … There is quite a bit of these happening when you load the page, and they sum in a quite visible load time. Then only when everything is pulled off the network, the app renders the screen.
I suppose this relates to my questioning about if we should free handles after each use or not , in the present case we free them almost every time, so we need to fetch them again, which costs both in time and network stress. I think one could optimise a lot by only freeing what is really not going to be used later, and keep everything else on hand for later. This would eat memory instead of time.
Also, this is all built around Mobx and React, which ,despite helping a lot with modularity and design, cost a lot in processing and memory. I am not experimented with these modern languages, and was grown at the age of assembly and C. In fact I would like a lot to be able to code these directly in C or Rust for example. Not only for speed but also for security concerns. But it would mean reinventing the wheel for design and display.

2 Likes

I’ve noticed it with quite a few SAFE apps - there’s a pause as they ‘boot up’ after which they generally tick along at a decent speed, sometimes slowing up when they write to the network. I’m sure it will be optimised at a later stage, indeed it’s important that it is for user acceptance, but really I’m just curious to know what the bottlenecks are.

4 Likes

Bug report #2 :).

2 Likes

I am pushing an update to the Safe Simple Forum.

The link remains : safe://simple-forum

I made a change to how the posts are structured, so your previous messages will all be deleted. ( I don’t think there was anything really important there ! )

This version brings :

  • very basic Markdown editor for topics and replies. Links and images are not supported yet, I still am working on porting the simplemde editor to Safe ( mainly stripping anything http :// from it , and converting to safe:// )
  • Replies count display : how many replies a topic recieved
  • Activity display : the time elapsed since a topic was replied
  • Working delete for the owner of the ‘domain’
  • Some CSS polishing

Next steps will be porting everything to the new API, enabling images and links, validating entries against nasty injections, enabling categories, ignore and ban lists.
There still needs a major cleanup in the code, and some bugs appear regularly, but I will try to address these , soon !

EDIT - I just spotted a little bug in the replies count and activity, so the first topic will have a replies reading a bit off : ) makes me think I should count keys instead of incrementing when publish )

13 Likes

Excellent work @nice! I will give it a spin later!

1 Like

I just updated the safe://simple-forum to the latest api, so now it seems to behave with the 0.8 browser and with peruse v0.2.0.

On the other hand, I ditched support for previous browser versions.

4 Likes

Looking forward to trying it out. So, is the aim to make something like this forum in the long run or is it more of a fun learning thing?

I’d say, both. As long as I’ll be able to afford the time that it takes, I will keep having fun learning as I make it evolve towards something like we have here on discourse !

3 Likes