this post was submitted on 17 Aug 2024
1 points (100.0% liked)

Perchance - Create a Random Text Generator

448 readers
17 users here now

โš„๏ธŽ Perchance

This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.

Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)

This community is mainly for discussions between those who are building generators. For discussions about using generators, especially the popular AI ones, the community-led Casual Perchance forum is likely a more appropriate venue.

See this post for the Complete Guide to Posting Here on the Community!

Rules

1. Please follow the Lemmy.World instance rules.

2. Be kind and friendly.

  • Please be kind to others on this community (and also in general), and remember that for many people Perchance is their first experience with coding. We have members for whom English is not their first language, so please be take that into account too :)

3. Be thankful to those who try to help you.

  • If you ask a question and someone has made a effort to help you out, please remember to be thankful! Even if they don't manage to help you solve your problem - remember that they're spending time out of their day to try to help a stranger :)

4. Only post about stuff related to perchance.

  • Please only post about perchance related stuff like generators on it, bugs, and the site.

5. Refrain from requesting Prompts for the AI Tools.

  • We would like to ask to refrain from posting here needing help specifically with prompting/achieving certain results with the AI plugins (text-to-image-plugin and ai-text-plugin) e.g. "What is the good prompt for X?", "How to achieve X with Y generator?"
  • See Perchance AI FAQ for FAQ about the AI tools.
  • You can ask for help with prompting at the 'sister' community Casual Perchance, which is for more casual discussions.
  • We will still be helping/answering questions about the plugins as long as it is related to building generators with them.

6. Search through the Community Before Posting.

  • Please Search through the Community Posts here (and on Reddit) before posting to see if what you will post has similar post/already been posted.

founded 1 year ago
MODERATORS
 

https://perchance.org/hash-links-plugin#edit

It's stuck in this while loop. I've seen it happen a couple of times before; it blocks saving too. But normally refreshing/reloading does the trick. For whatever reason, here it always gets stuck no matter what, which means I can't fix a bug in my code, which means that entire plugin and anything that imports it (all my generator pages) breaks entirely. Editing them, I can remove stuff to try to temp fix it, it seems to save, then I reload and the save hasn't actually saved, and there's nothing I can do about it ๐Ÿ˜ฌ

while (!window[sadf5456])
  await new Promise(r=>window[lkjsfh83](r, 1000));

This is where it's stuck. Something to do with waiting for "riot" to load? ARRRRGHGHG!

top 10 comments
sorted by: hot top controversial new old
[โ€“] wthit56 1 points 2 months ago

Tried setting window.riot = true; which does break that loop. But it's stuck in some other infinite loop it seems?

Could theoretically not be the cause of it not being savable, but it's all I got.

[โ€“] wthit56 1 points 2 months ago
[โ€“] perchance 1 points 2 months ago* (last edited 2 months ago) (3 children)

Thanks! Sorry about that - this bug is fixed now.

Aside: Where is window[sadf5456]? Do you have an old version of the Perchance editor/interface due to a local response override in DevTools? Perchance doesn't use riot at all anymore.

[โ€“] wthit56 1 points 2 months ago (1 children)

Seems to be just the main file or whatever. The source tab just says "hash-links-plugin". I've downloaded it and can send it if you want?

[โ€“] perchance 1 points 2 months ago* (last edited 2 months ago) (1 children)

Ah thanks, found and deleted it - old code that had no effect anymore (it had no impact on the issue you've reported here, to be clear - it's unfortunate how hard it is to track down async stuff like this via pausing the debugger, which I'm guessing is how you hit upon this false positive).

[โ€“] wthit56 1 points 2 months ago

Yeah, it was a pause--because of the loading thing still going I thought it was caught in a loop or something. Which... it sort of was, and sort of not ๐Ÿ˜‚

[โ€“] wthit56 1 points 2 months ago (1 children)

Everything is loading now. Phew!

What was causing that?

[โ€“] perchance 1 points 2 months ago (1 children)

What was causing that?

The iframe signals the the parent/editor frame when it's finished loading, but the error in the dependency caused the iframe to never send that signal, because I didn't try/catch it properly.

[โ€“] wthit56 1 points 2 months ago

Ah I see. Well done, thanks for sorting it ๐Ÿ‘

[โ€“] wthit56 1 points 2 months ago

This is the larger function:

			document.addEventListener("DOMContentLoaded", async(event)=>{
				let sadf5456 = `r i  o t`['replace'](/ /g, "");
				let lkjsfh83 = `s et Ti m e o ut`['replace'](/ /g, "");
				let sdf435i3hkf = "document";
				let a = window[sdf435i3hkf].body;
				while (!window[sadf5456])
					await new Promise(r=>window[lkjsfh83](r, 1000));
				await new Promise(r=>window[lkjsfh83](r, 5000));
				if (!window.da_Zz3qe33sEsZ1 || !window.hu_8urej4) {
					a.innerHTML = window.mdded4sfef4dsedddse1d34344;
					window[`successfulPag${""}Load`] = false;
				}
			}

sadf5456 is the value "riot".

It's now working--thank you!