The-CodingSloth / haha-funny-leetcode-extension

MIT License
396 stars 75 forks source link

Bug: Extension doesn't detect problem is solved #52

Open morenoh149 opened 10 months ago

morenoh149 commented 10 months ago

I am using the new leetcode dynamic UI. (https://leetcode.com/discuss/feedback/4041069/Feedback%3A-Dynamic-Layout-is-technically-impressive-but-poor-design-and-UX.)

And now when I solve the leetcode gulag extension problem of the day the extension does not let me browse the internet.

Browser: Brave browser

Edit: I tried the extension again and I don't think the bug is related to the new Leetcode UX.

The-CodingSloth commented 10 months ago

Uploaded a new version to the public webstore with some small changes that should be coming in a few days. Let me know if that issue still happens when its public, or clone this repo to test it out right now. I've seen this happen sometimes, but I'm not too sure myself. Hopefully this minimizes/removes this bug.

IlyaBaksonyan commented 10 months ago

still happening

https://youtu.be/Ot8Be4OPh6M

(Let me outttttttttttttt)

The-CodingSloth commented 10 months ago

hmmm I'm not sure why this happens only sometimes. I'm curious if anyone can figure out where it's not working. It has to be in the checkIfUserSolvedProblem function in background.ts or the congratuationModal's handleClick function is not executing. I'll see if I can figure anything out. But if anyone wants to try it out too, feel free because I'm confused.

The-CodingSloth commented 10 months ago

I'd appreciate anyone that's contributing to provide some logs for the checkIfUserSolvedProblem function to see what's happening for these submissions that aren't being accepted.

LucasJoel1 commented 10 months ago

Having this issue as well using brave, first issue is that brave seems to be denying it access to certain content the extension needs to work, to fix this, go to the extension settings and enable the setting that says Allow access to file urls, second on in the console in dev tools, it is stating: Screenshot 2023-09-17 174206

Line specified: image

The-CodingSloth commented 10 months ago

I added a possible fix, no clue if that really worked. I tested it on Chrome and Brave and seemed to work. Added small console messages too when submitting. Let me know if that worked on the development build. And thanks for letting me know about that files url issue, and this extension context (seems to be a framework bug). I'll check that out

LucasJoel1 commented 10 months ago

That does not appear to have fixed the problem. No errors have shown up in the console and I have given it all permissions. If there is a logs file I can send you, please let me know so I can do so

Tayomide commented 10 months ago

I just checked it, the development code works fine, but the extension on the web store does not

The-CodingSloth commented 10 months ago

hmmm that's interesting can you screenshot the logs or drag them into this discussion. Some people have this issue and some don't, really has me confused lmao

Tayomide commented 10 months ago

Here's a Vimeo link showing the issue https://vimeo.com/865414717/2d6403a421

There are also no logs for the extension on the web store, maybe removing the logs also removed an important logic with it

IlyaBaksonyan commented 10 months ago

hmmm that's interesting can you screenshot the logs or drag them into this discussion. Some people have this issue and some don't, really has me confused lmao

you're already immersed in the normal problems of business!

The-CodingSloth commented 10 months ago

hmmm that's interesting can you screenshot the logs or drag them into this discussion. Some people have this issue and some don't, really has me confused lmao

you're already immersed in the normal problems of business!

Yep already hate it lmao. So the web store version isn't working, but is this current development version working? If it is, I can publish this new version for now since it might minimize the problem

IlyaBaksonyan commented 10 months ago

hmmm that's interesting can you screenshot the logs or drag them into this discussion. Some people have this issue and some don't, really has me confused lmao

you're already immersed in the normal problems of business!

Yep already hate it lmao. So the web store version isn't working, but is this current development version working? If it is, I can publish this new version for now since it might minimize the problem

but because of you I got into leetcode for the first time in 4 years and even already solved 5 problems. And it seems like that I'm not the only one who did this.

Tayomide commented 10 months ago

Yeah, it does work👍

You could try creating sprints, goals to be accomplished at the end of the week and then do a code review before choosing to deploy the newest update to chrome web store

I'm sure there are a lot of videos of that on YouTube, and GitHub has a Kanban board at the Projects tab The main branch will only be updated after the code review, and maybe even write tests before the start of each week's sprint and only accept code that passes the test

The-CodingSloth commented 10 months ago

Awesome, I think that's a pretty good idea to organize things a bit more and have proper version releases. I'll do research and see how I could do it. Would probably need to start by having important extension tests

The-CodingSloth commented 10 months ago

hmmm that's interesting can you screenshot the logs or drag them into this discussion. Some people have this issue and some don't, really has me confused lmao

you're already immersed in the normal problems of business!

Yep already hate it lmao. So the web store version isn't working, but is this current development version working? If it is, I can publish this new version for now since it might minimize the problem

but because of you I got into leetcode for the first time in 4 years and even already solved 5 problems. And it seems like that I'm not the only one who did this.

Just wanted to say that's amazing. Did not expect this extension to actually be used, it was just a funny idea I had and wanted to try it out.

Tayomide commented 10 months ago

That would be cool! I'm looking forward to it! If it gets exhausting, you could move the sprints to more weeks, and GitHub actions could also help a lot with the automation of the tests! You'll basically be a project manager

The-CodingSloth commented 10 months ago

Apparently this bug is still happening, to the people that have had this bug. can you let me know:

  1. What problem set you used (all leetcode problems, neetcode 150, blind 75, etc)
  2. The problem it was (if you remember)
  3. Browser you used.
LucasJoel1 commented 10 months ago

Problem set used: All problems Problem it was: Was issue with any problems as I unoaded and reloaded the extension giving me a new problem each time Browser: Brave

Private-programmer commented 10 months ago

Hi,

I had this issue as well.

Problem set used: All problems Problem it was: I don't remember (sorry 😔) Browser: Chrome

Not sure if it will help but I also set the problem difficulty to easy.

The-CodingSloth commented 10 months ago

alright I just pushed a change in the code, can anyone test this out like a bunch of times. just resave the code to generate a new problem. I'm hoping this fixed it or i'm gonna go crazy, this bug is so rare, but it happens enough that it affects the torture experience.

Tayomide commented 10 months ago

The development code always worked for me, but the extension on chrome web store didn't

I'll check the new one out!

The-CodingSloth commented 10 months ago

yeah it took me like 30+ attempts to get it to happen and debug it, but when there's apparently 100s of users it was bound to happen to people (gotta love publicly used software)

Tayomide commented 10 months ago

On a side note could you walk me through setting up prettier? or that stuff you use to format the code, I tried setting it up but it never worked for me

Also, does it take a long time for the chrome web store to accept new updates?

The-CodingSloth commented 10 months ago

I'm just using the prettier extension from vs code, and prettier just automatically detects the file in codebase. Also Chrome takes like 1-2 days to update the extension which is really annoying. Side note: if you guys haven't already should probably join the discord if you want to talk with me and other people, so we don't spam these discussions lmao: Here's the link Discord invite

Tayomide commented 10 months ago

Thanks!

Done, I joined the discord!

I tried about 10 times, and there doesn't seem to be a problem with the dev code.

The-CodingSloth commented 10 months ago

people still had this problem, so I changed the logic a bit and it should've hopefully fixed it, if anybody can test it out for me I'd appreciate it

Tayomide commented 10 months ago

The recent changes have been updated on the extension, but it still doesn't work for me. I'll check if the new code in the repo works for me(it always has)

I don't know if this might be important, but I have more than 50 tabs open right now. I've had them all open since the first time I had the problem

The-CodingSloth commented 10 months ago

LOL I think this issue mainly happens in the build version when you do npm run build. It looked like a service worker issue when it became inactive, so when you're testing leave the extension and don't solve the problem until you see it say service worker inactive on the extension page.

Tayomide commented 10 months ago

Got it! I'll do that now👍

shamir0xe commented 10 months ago

I still have this issue, I solved more than 10 problems in order to get rid of the freaking tortures, but It's spread its webs over my throat. I forced to use safari instead of my dear Chrome, please ELP!

Tayomide commented 10 months ago

Hey!

Could you reinstall the extension and try it again? It works for me now👌

morenoh149 commented 9 months ago

Hey!

Could you reinstall the extension and try it again? It works for me now👌

Yeah I just tested it today and yesterday.

When I try to load a webpage I get directed to the gulag's problem of the day (potd). I then solve it but I'm still not allowed to open other websites.

When I click on the extension's icon in the toolbar and open the potd and then resubmit my solution then I can browse freely.

Tayomide commented 9 months ago

Dang💔 That's next-level torture Maybe there'll be a week where we just upgrade this extension You could also get your hands dirty if you have some time on you Good luck!

shamir0xe commented 9 months ago

Hey!

Could you reinstall the extension and try it again? It works for me now👌

I did reinstall it but It doesn't work still :(

shamir0xe commented 9 months ago

I solved the issue by disabling CORS with an ALLOW CORS extension. It should be fixed by setting the origin header of some requests in the code instead of disabling the CORS globally (something like this: "Access-Control-Allow-Origin: *"). Cheers!

morenoh149 commented 9 months ago

I'm still testing this. lmk if you want me to make a fresh issue.

My current issue is that

  1. I try to browse the internet and am redirected to potd
  2. I solve the problem after clicking around on the site, maybe reading the discussion and browsing devdocs.io (I always have the docs open in another tab)
  3. I then reopen the potd from the extensions icon in the browser
  4. I resubmit my solution to potd
  5. Now I can browse freely.
Tayomide commented 9 months ago

Oh, I think it works perfectly for you! You could go to the settings tab to change the difficulty or change the problem set you get your question from using the dropdown but that was coding sloth's actual plan of the extension, it's torture😎

morenoh149 commented 9 months ago

@Tayomide so we're supposed to reopen the potd? why can't the extension detect you solved the problem the first time you open leetcode that day?