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

Failed service queries still deduct currency. #230

Open
AnchyDev opened this issue May 27, 2023 · 10 comments
Open

Failed service queries still deduct currency. #230

AnchyDev opened this issue May 27, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@AnchyDev
Copy link

AnchyDev commented May 27, 2023

When creating a service query on the store, if your query fails for whatever reason (no rows affected for example) your currency is still deducted.

It would be nice if query was verified first to see if it affected any rows or failed before deducting the currency and checking out.
You can replicate this issue by:

  • Create a new store item with the Query item type.
  • Write a query that you know will not affect any rows and save.
  • Use the store and observe it still takes your money.
@CraftedRO
Copy link
Collaborator

yea I can confirm, it only check if realm is online and if it is on it will execute the query (even if is wrong) and take your currency then it will appear: Your order has been processed.

Anyway we need also a fix for the other case when the query is correct it seems it will execute it but after you checkout the spinner remain stuck spinning without announcement with your order status (even if it has been executed already) so you have to force refresh the page.

@Err0r1
Copy link
Collaborator

Err0r1 commented May 27, 2023

In my opinion, you don't need a check for that
if you can't write or test a query properly, you shouldn't use the query option anyway

I don't see a bug here either
As far as I know there is no safe way to get the affected rows

I played around a lot with "$this->db->affected_rows()" because of my modules and it often shows 0, even though the query was executed

But the whole store needs an update in my opinion

@CraftedRO
Copy link
Collaborator

yea agree, but still we need a fix for the case when query is correct and spinner remain stuck without notice you the final status of the order like

@Err0r1
Copy link
Collaborator

Err0r1 commented May 27, 2023

Can you explain it?
Do you mean if the query fails?

@CraftedRO
Copy link
Collaborator

2023-05-27.21-57-07.mp4

@Err0r1
Copy link
Collaborator

Err0r1 commented May 27, 2023

Is there an error in the log file or browser console?
As far as i know, query also shows a success message

@CraftedRO
Copy link
Collaborator

well I got only

ERROR - 2023-05-27 21:15:17 --> Invalid query: (nothing here)

but as you can see in video is really valid

you can try too my cms query:

UPDATE account_data SET avatar=1 WHERE id={ACCOUNT};

@Err0r1
Copy link
Collaborator

Err0r1 commented May 27, 2023

Can you try it without ";" ?

@CraftedRO
Copy link
Collaborator

well ok now worked without ";" kinda strange but usually you need an end to any query 😀

@AnchyDev
Copy link
Author

In my opinion, you don't need a check for that if you can't write or test a query properly, you shouldn't use the query option anyway

I don't see a bug here either As far as I know there is no safe way to get the affected rows

I played around a lot with "$this->db->affected_rows()" because of my modules and it often shows 0, even though the query was executed

But the whole store needs an update in my opinion

Sorry, I didn't explain the issues we are having enough I guess and maybe this should be a feature request.

We need to run a query to detect if the player should be able to use the service based on other parameters, so sometimes the query will change 0 rows because they don't meet the requirements.
Maybe having another query box where we can write a select statement and if it returns no rows then the store will tell the player they are not eligible for this service?

If a similar feature exists already it would be greatly appreciated if pointed out. Thanks.

@CraftedRO CraftedRO added the enhancement New feature or request label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants