Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script Group counter #93

Closed
Dexmaster opened this issue May 10, 2014 · 6 comments
Closed

Script Group counter #93

Dexmaster opened this issue May 10, 2014 · 6 comments
Labels
bug You've guessed it... this means a bug is reported.

Comments

@Dexmaster
Copy link

Group counter doesn't decrement after script was deleted.

@sizzlemctwizzle
Copy link
Member

I totally forgot about that use case. Thanks.

@Martii Martii self-assigned this Feb 23, 2016
Martii pushed a commit to Martii/OpenUserJS.org that referenced this issue Feb 23, 2016
* This will probably be needed for ordered and decrementing mass removals down the line... and uncovered a few logic issues
* Add some TODOs ... since this is a work in progress guestimating what should be done... final may be slightly different
* Some STYLEGUIDE.md conformance
* Add an error handler in `getFlaggedListForContent`... this will tell us if a flag has been found but no user in the non-long-term... Post OpenUserJS#643 fix in Moderation eyeball

**NOTES**
* Tested mostly on dev and some on local pro

Applies to OpenUserJS#126, OpenUserJS#93 and trounces madly upon OpenUserJS#262 (comment) ... sawwy but tiz a boog.
@Martii Martii removed their assignment Feb 23, 2016
@Martii
Copy link
Member

Martii commented Feb 5, 2019

Just a FYI here for this one... the code at

// Wait two hours between group rating updates
// This calculation runs in the background
if (new Date().getTime() > (group.updated.getTime() + 1000 * 60 * 60 * 2)) {
is showing it to self correct the size when I made it every 10 seconds, deleted a script added to an existing group, and refreshed the page at about 15 seconds later. e.g. wait 2 hours currently and I think it indeed does correct itself on the "Size" column for this use case.

Although I have been noticing Script._id's that are no longer around in Group._scriptIds which may affect the rating or something else perhaps. Looking into it.

@Martii
Copy link
Member

Martii commented Feb 5, 2019

And if it's the only script in the group that's when it doesn't reset after the modified 10 second period.

@Martii Martii self-assigned this Feb 5, 2019
@Martii
Copy link
Member

Martii commented Feb 5, 2019

ffa194b

Martii referenced this issue Feb 5, 2019
* Tested on dev and it zapped every empty group there during this period.
* Make a more reasonable period for dev vs pro. Waiting 2 hours shouldn't be needed... set to 60 seconds in dev.

Applies to #83 

Auto-merge
Martii added a commit to Martii/OpenUserJS.org that referenced this issue Feb 5, 2019
NOTE:
* Don't fully understand sizzle logic here with rating but this fixes `Size` and keeps the `Rating` at last known value until another script is added. `bongacams` has only `1` but never gets updated from `2`. Presume there is more. will have to go through them all again.

Applies to OpenUserJS#93
Martii added a commit that referenced this issue Feb 5, 2019
NOTE:
* Don't fully understand sizzle logic here with rating but this fixes `Size` and keeps the `Rating` at last known value until another script is added. `bongacams` has only `1` but never gets updated from `2`. Presume there is more. will have to go through them all again.

Applies to #93 

Auto-merge
Martii added a commit to Martii/OpenUserJS.org that referenced this issue Feb 5, 2019
* Referred to as a collective rating in the code... this value should be zero according to that routine.
* That routine already has this but I assume it's a "double check?" since `aScripts` can change on the fly... anyhow... groups with 1 script should have a "collective rating" of zero according to the function... so mirroring

Applies to OpenUserJS#93 and post OpenUserJS#1581
Martii added a commit that referenced this issue Feb 5, 2019
* Referred to as a collective rating in the code... this value should be zero according to that routine.
* That routine already has this but I assume it's a "double check?" since `aScripts` can change on the fly... anyhow... groups with 1 script should have a "collective rating" of zero according to the function... so mirroring

Applies to #93 and post #1581 

Auto-merge
Martii added a commit to Martii/OpenUserJS.org that referenced this issue Feb 5, 2019
Martii added a commit that referenced this issue Feb 5, 2019
Martii added a commit to Martii/OpenUserJS.org that referenced this issue Feb 6, 2019
Martii added a commit that referenced this issue Feb 6, 2019
Applies to #93 

Auto-merge
@Martii
Copy link
Member

Martii commented Feb 6, 2019

I totally forgot about that use case.

So here's a use case scenario...

Add new script to group then delete; add new script to group, then delete; add new script to group, then delete; add new script to group, then delete; add new script to group, then delete; etc.

... causing lots of Script queries. While this can be indexed it's still consuming resources. Yes there has been precedence for this which is why the commit references are in this issue to curtail some of that.

I think the two hour interval between resynching is the right way to go and is currently a post op on access (PPP, restful)... albeit that max value might be able to be tweaked a little. We'll see how this goes over the next long term period and see if it needs adjustment. :)


Plus there is a pre op when adding... so that resynchs too.

@Martii Martii added needs testing Anyone can add this but it is primarily there for the Assignee indicating that Testers are wanted. later A long time ahead, in a galaxy near, near... labels Feb 6, 2019
@Martii
Copy link
Member

Martii commented Feb 6, 2019

Closing from no further comments. Please leave a message if the issue resurges outside of that period.

@Martii Martii closed this as completed Feb 6, 2019
@Martii Martii removed later A long time ahead, in a galaxy near, near... needs testing Anyone can add this but it is primarily there for the Assignee indicating that Testers are wanted. labels Feb 6, 2019
@Martii Martii removed their assignment Feb 6, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug You've guessed it... this means a bug is reported.
Development

No branches or pull requests

3 participants