[nodebb-plugin-ns-spoiler] NS Spoiler
-
After enabling the plugin and restarting the forum uses a very high CPU power, seconds alter the forum goes offline.
The part in the red area is when I tested the plugin.
After resetting the NS spoilers plugin, the forum was back online and accessible again.
I installed the version in the ACP.
The testpost I made was
:::
Sander hallo
:::In a topic with 2200+ posts
NodeBB v1.2.1.
-
v3 version of the plugin?
Did you have any errors in the console?
Do you use other plugins which parse posts? -
@Nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:
v3 version of the plugin?
nodebb-plugin-ns-spoiler
Latest 3.0.0Did you have any errors in the console?
[33mwarn[39m: [plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run
./nodebb reset -p PLUGINNAME
to disable it.
[33m * [39mnodebb-plugin-dailymotionDo you use other plugins which parse posts?
I use these plugins
nodebb-plugin-composer-default
nodebb-plugin-custom-pages
nodebb-plugin-dailymotion
nodebb-plugin-dbsearch
nodebb-plugin-embed-combo
nodebb-plugin-google-analytics
nodebb-plugin-google-search
nodebb-plugin-gravatar
nodebb-plugin-imgbed
nodebb-plugin-imgur
nodebb-plugin-markdown
nodebb-plugin-mentions
nodebb-plugin-ns-points
nodebb-plugin-soundpack-default
nodebb-plugin-youtube-embed
nodebb-rewards-essentials
nodebb-theme-persona
nodebb-widget-essentials -
Embed Plugins parse content. Content parsing is an important step for the spoiler. When you are trying to get spoiler content, it goes though parsing process again, but only content. Maybe some plugin relies on the content. I think there could be a problem, when someone clicks on the spoiler to get It's content. Would be great if you can isolate your system for the single user, and just surf your forum, don't click spoilers. will you have CPU load?
-
@Nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:
Embed Plugins parse content. Content parsing is an important step for the spoiler. When you are trying to get spoiler content, it goes though parsing process again, but only content. Maybe some plugin relies on the content. I think there could be a problem, when someone clicks on the spoiler to get It's content. Would be great if you can isolate your system for the single user, and just surf your forum, don't click spoilers. will you have CPU load?
I did. Always when I install a new plugin I set the forum to 'maintenance mode'. So I was the only one who was at the site. I try it again tonight when it's empty on my forum. I post the result
-
@Nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:
Version 3.0.0
New version is available. Summary: different approach how spoiler content is populated. If you are not interested in major feature of v3, I recommend to use v2 of the plugin. Idea of v3 is to lazy load spoiler content only when It's needed. When web page is downloaded by the client there is no spoiler content.
- Change spoiler delivering. Content of a spoiler isn't delivered anymore to the client.
- Change HTML manipulation to create more safe result for paragraphs
- Add requirement for multi-line spoiler, i.e. inline spoiler will not be parsed (will be converted to multiline)
new update breaks my forum
==== JS stack trace =========================================
Security context: 0x3090f03b4629 <JS Object>
2: format [util.js:~20] [pc=0x373b8e220cb1] (this=0x1ad68a34bb09 <an Object with map 0xd5216ae4a91>,f=0x5aa3e282289 <String[213]: <div class="ns-spoiler" data-index="%d" data-open="false"><div class="ns-spoiler-control"><a class="btn btn-default" href="#"><i class="fa fa-eye"></i> spoiler</a></div><div class="ns-spoiler-content"></div></div>>)
3: arguments adaptor frame: 2->1
4: /* ... -
Try
3.0.2
. It should work well. -
@Nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:
@exodo Your error is related to V8.
Both issues (@MJ and @exodo ) I can reproduce, when I downgrade to
Node 4.0.0
.
I will investigate issue and push a patch updateJust curious what is v8
I have node 5.0 -
@Nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:
Try
3.0.2
. It should work well.just installed, no errors
but it doesnt seem to load spoilers correctly
-
@exodo said in [nodebb-plugin-ns-spoiler] NS Spoiler:
but it doesnt seem to load spoilers correctly
Interesting. This error is generated by the plugin. Plugin can not find a corresponding content of the spoiler. Would be great if you will give more information what you are doing, what type of formatting you use.
It doesn't work for you for all spoilers or only some of them?
-
@Nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:
@exodo said in [nodebb-plugin-ns-spoiler] NS Spoiler:
but it doesnt seem to load spoilers correctly
Interesting. This error is generated by the plugin. Plugin can not find a corresponding content of the spoiler. Would be great if you will give more information what you are doing, what type of formatting you use.
It doesn't work for you for all spoilers or only some of them?
@Nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:
@exodo said in [nodebb-plugin-ns-spoiler] NS Spoiler:
but it doesnt seem to load spoilers correctly
Interesting. This error is generated by the plugin. Plugin can not find a corresponding content of the spoiler. Would be great if you will give more information what you are doing, what type of formatting you use.
It doesn't work for you for all spoilers or only some of them?
It happens with all of them
I use a custom persona theme. Not sure if that will affect -
-
@Nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:
How can I check this? (sorry for asking :()
@Nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:
I have visited your link, but I can't see spoiler content, It's unauthorized request for me, I need to register.
It's because no spoiler content can be loaded. That's the error. When users press the spoiler button nothing happens.
-
Easiest test guys:
create a single post with only one spoiler, let's say content of the spoiler like this:
::: spoiler content :::
Three questions:
- Does it render properly your spoiler? It should have only a single button in the post.
- Inspect HTML of your post with a spoiler, what
index
do you see there?data-index
ofdiv.ns-spoiler
- When you click a spoiler button, do you see an original content or an error in the console? Content of the error?
-
@Nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:
Easiest test guys:
create a single post with only one spoiler, let's say content of the spoiler like this:
::: spoiler content :::
Three questions:
- Does it render properly your spoiler? It should have only a single button in the post.
- Inspect HTML of your post with a spoiler, what
index
do you see there?data-index
ofdiv.ns-spoiler
- When you click a spoiler button, do you see an original content or an error in the console? Content of the error?
Have you seen that?
(posted by @exodo a few days ago)
Here you have the problem, you must check server side the type of the 'postId' parameter and convert to string to be sure it will return post content. You should add the conversion on this line.
-