serious trouble with actions on custom operations

Bug and problem reporting on Cyclos 4 version

Moderators: rmvanarkel, hugo, alexandre

Post Reply
admin_de2
Posts: 107
Joined: Wed Dec 31, 1969 9:00 pm

serious trouble with actions on custom operations

Post by admin_de2 »

Dear Cyclosians,

we hit a serious issue with actions of custom operations.
In this case, the 2nd internal action is the one causing problems:
  • * It processes the form of step 1 and executes a transaction with a specified amount.
    * It shows then the result with some amounts and "finished"-message.
Now, when the user reloads the browser (F5), or, e.g. switches the language, the whole process is done once more:
There are two same transactions on user's account then.

This was making us wonder, since the P-R-G-design-pattern won popularity last years for exactly the reason avoiding trouble of doulicated purchases, payments, ... by redirecting to another page after the process.

Please refer to https://www.geeksforgeeks.org/post-redi ... n-pattern/ as a sample.

Can you please commit this bug and please fix it?

Is there any workarround / solution in scripting- or cyclos-context for it? Thank you!
(How is it supposed to be?!?)

Thank you,
Thomas
luis
Posts: 207
Joined: Fri Feb 17, 2006 11:01 am

Re: serious trouble with actions on custom operations

Post by luis »

Thanks for noticing and reporting this.
Cyclos is a single page application (SPA). It doesn't do any requests for pages to the server, only for data. So the PRG / Redirect After Post doesn't apply.
We will investigate the subject to prevent this issue.
Luis Fernando Planella Gonzalez
Cyclos development team
luis
Posts: 207
Joined: Fri Feb 17, 2006 11:01 am

Re: serious trouble with actions on custom operations

Post by luis »

A workaround is to use a Wizard instead of chained custom operations.
On wizards this double execution never happens.
Luis Fernando Planella Gonzalez
Cyclos development team
jakob.schumann
Posts: 27
Joined: Thu Apr 23, 2020 5:37 pm

Re: serious trouble with actions on custom operations

Post by jakob.schumann »

Hello Luis,

thanks for the suggestion! Are there any more code examples for wizards than the paypal integration in the documentation?

I could not figure out if the following is possible, I assume not:

Step 1: ask for user input -> works
Step 2: show some html output like it's possible in the final code block / in custom operations and only ask the user for confirmation, no more form fields. Or show some error messages why the operation is currently not possible -> I haven't seen a possibility to output something besides the notifications via storage.info() etc. But notifications aren't enough, we need to show multiple fields in something like a table.
Step 3: perform a payment & show html output -> seems to be possible
luis
Posts: 207
Joined: Fri Feb 17, 2006 11:01 am

Re: serious trouble with actions on custom operations

Post by luis »

It seems that wizards won't fit exactly this use case.
I'm still trying to fix the operations issue for 4.14.11, which will be released this week.
Luis Fernando Planella Gonzalez
Cyclos development team
admin_de2
Posts: 107
Joined: Wed Dec 31, 1969 9:00 pm

Re: serious trouble with actions on custom operations

Post by admin_de2 »

Dear Luis,

that would be awesome.
Awaiting the reponse about this issue here or in the release notes.

Many thanks!
Thomas
luis
Posts: 207
Joined: Fri Feb 17, 2006 11:01 am

Re: serious trouble with actions on custom operations

Post by luis »

The 4.14.11 has been released and includes the fix for this.
So, if you refresh in a custom operation action, you will just see an error indicating that the action was already executed, and that the operation should be restarted.
Luis Fernando Planella Gonzalez
Cyclos development team
Post Reply