Always checked :
Hello,
I have discovered in my database the Meteor Method have been executed several times from click or keypress.
I don't manage to trigger the bug.
Here my code :
class Answering extends Component {
...
validAnswer() {
...
validAnswer.call({
...
});
}
...
render() {
return (
...
<div
id="Answering-button-next"
role="button"
onClick={() => { this.validAnswer(); }}
onKeyPress={(e) => { if (e.key === 'Enter') this.validAnswer(); }}
tabIndex="0"
>OK
</div>
How can fix this bug ?
Thank you
I found the bug,
The bug comes from the disconnection of server.
When you Server is disconnected and the user clicks on a button that calls a method ... so ... nothing happens ... and user continue to click on the button and Meteor keeps in Memory all actions.
Then, when the Server comes back and turns on, so , all client requests are sent to server.
Thus, the method is called several times.
Hope, I was clear ;-)