Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Queue PromptRequest instead of override them #8989

Closed
Amejia481 opened this issue Nov 16, 2020 · 1 comment
Closed

Queue PromptRequest instead of override them #8989

Amejia481 opened this issue Nov 16, 2020 · 1 comment
Assignees
Labels
🐞 bug Something isn't working <prompts> Component: feature-prompts

Comments

@Amejia481
Copy link
Contributor

Amejia481 commented Nov 16, 2020

When a new prompt request is created we are overwritten the existing one, that could cause some issues as we only are allowing one prompt to be visible at the time, some pages could create other prompt requests without the first one be proceeded and break some functionality for some pages. Below an example:

<!DOCTYPE html>
<html>
<body>

<p>Click the button to wait 3 seconds, then alert "Hello".</p>
<p>After clicking away the alert box, an new alert box will appear in 3 seconds. This goes on forever...</p>
<input type="file" onclick="myFunction()">Try it</button>

<script>
function myFunction() {
  setInterval(function(){ alert("Hello"); }, 2000);
}
</script>

</body>
</html>

┆Issue is synchronized with this Jira Task

@Amejia481 Amejia481 added 🐞 bug Something isn't working <prompts> Component: feature-prompts labels Nov 16, 2020
@Amejia481 Amejia481 self-assigned this Nov 16, 2020
Mugurell added a commit to Mugurell/android-components that referenced this issue May 17, 2021
Mugurell added a commit to Mugurell/android-components that referenced this issue May 17, 2021
Mugurell added a commit to Mugurell/android-components that referenced this issue May 18, 2021
Mugurell added a commit to Mugurell/android-components that referenced this issue May 18, 2021
This try-catch was added in mozilla-mobile#6687 as an effort to better individualize prompt
cast exceptions in our crash reporting platforms to better asses their
frequency and hopefully get more data to debug and fix the underlying issue.

The original issue is resolved in the first commit of this patch so there is no
need to keep the try-catch.
Mugurell added a commit to Mugurell/android-components that referenced this issue May 18, 2021
Following crash reports it was seen that it is possible for multiple prompts to
be shown at the same time with an edgecase being that one prompt request comes
after the user interacted with a previous prompt but before the consume call
completing in AC / GV time at which this code will try to use the new prompt,
not the one the user interacted with.

Having support for multiple prompt requests in ContentState and tightly
coupling a PromptDialogFragment with it's PromptRequest ensures any action
consuming a PromptDialogFragment will always consume the PromptRequest for
which that dialog was shown irrespective of the number of prompts or which is
currently shown on top.
Mugurell added a commit to Mugurell/android-components that referenced this issue May 18, 2021
This try-catch was added in mozilla-mobile#6687 as an effort to better individualize prompt
cast exceptions in our crash reporting platforms to better asses their
frequency and hopefully get more data to debug and fix the underlying issue.

The original issue is resolved in the first commit of this patch so there is no
need to keep the try-catch.
Mugurell added a commit to Mugurell/android-components that referenced this issue May 18, 2021
This try-catch was added in mozilla-mobile#6687 as an effort to better individualize prompt
cast exceptions in our crash reporting platforms to better asses their
frequency and hopefully get more data to debug and fix the underlying issue.

The original issue is resolved in the first commit of this patch so there is no
need to keep the try-catch.
@Mugurell
Copy link
Contributor

Talked with Arturo a bit more and looked more into the code from PromptFeature.
I was thinking of just having to keep a stack of PromptRequests but saw that we need these mapped to a stack of PromptDialogs (there are also two Views (as opposed to Dialogs) to display 2 specific PromptRequests).
Then this are to be updated - added to / removed from in multiple places in PromptFeature.
Working on this idea I found some issues

@Amejia481 It's hard to work around these and trying to fix them exceeds the initial scope. To me it seems one of those situations in which a feature needs to get back to the drawing board and rethought/rewritten to best fit the current needs.

Mugurell added a commit to Mugurell/android-components that referenced this issue May 24, 2021
Following crash reports it was seen that it is possible for multiple prompts to
be shown at the same time with an edgecase being that one prompt request comes
after the user interacted with a previous prompt but before the consume call
completing in AC / GV time at which this code will try to use the new prompt,
not the one the user interacted with.

Having support for multiple prompt requests in ContentState and tightly
coupling a PromptDialogFragment with it's PromptRequest ensures any action
consuming a PromptDialogFragment will always consume the PromptRequest for
which that dialog was shown irrespective of the number of prompts or which is
currently shown on top.
Mugurell added a commit to Mugurell/android-components that referenced this issue May 24, 2021
This try-catch was added in mozilla-mobile#6687 as an effort to better individualize prompt
cast exceptions in our crash reporting platforms to better asses their
frequency and hopefully get more data to debug and fix the underlying issue.

The original issue is resolved in the first commit of this patch so there is no
need to keep the try-catch.
Mugurell added a commit to Mugurell/android-components that referenced this issue May 26, 2021
Following crash reports it was seen that it is possible for multiple prompts to
be shown at the same time with an edgecase being that one prompt request comes
after the user interacted with a previous prompt but before the consume call
completing in AC / GV time at which this code will try to use the new prompt,
not the one the user interacted with.

Having support for multiple prompt requests in ContentState and tightly
coupling a PromptDialogFragment with it's PromptRequest ensures any action
consuming a PromptDialogFragment will always consume the PromptRequest for
which that dialog was shown irrespective of the number of prompts or which is
currently shown on top.
Mugurell added a commit to Mugurell/android-components that referenced this issue May 26, 2021
This try-catch was added in mozilla-mobile#6687 as an effort to better individualize prompt
cast exceptions in our crash reporting platforms to better asses their
frequency and hopefully get more data to debug and fix the underlying issue.

The original issue is resolved in the first commit of this patch so there is no
need to keep the try-catch.
Mugurell added a commit to Mugurell/android-components that referenced this issue Jun 2, 2021
Following crash reports it was seen that it is possible for multiple prompts to
be shown at the same time with an edgecase being that one prompt request comes
after the user interacted with a previous prompt but before the consume call
completing in AC / GV time at which this code will try to use the new prompt,
not the one the user interacted with.

Having support for multiple prompt requests in ContentState and tightly
coupling a PromptDialogFragment with it's PromptRequest ensures any action
consuming a PromptDialogFragment will always consume the PromptRequest for
which that dialog was shown irrespective of the number of prompts or which is
currently shown on top.
Mugurell added a commit to Mugurell/android-components that referenced this issue Jun 2, 2021
This try-catch was added in mozilla-mobile#6687 as an effort to better individualize prompt
cast exceptions in our crash reporting platforms to better asses their
frequency and hopefully get more data to debug and fix the underlying issue.

The original issue is resolved in the first commit of this patch so there is no
need to keep the try-catch.
mergify bot pushed a commit that referenced this issue Jun 2, 2021
Following crash reports it was seen that it is possible for multiple prompts to
be shown at the same time with an edgecase being that one prompt request comes
after the user interacted with a previous prompt but before the consume call
completing in AC / GV time at which this code will try to use the new prompt,
not the one the user interacted with.

Having support for multiple prompt requests in ContentState and tightly
coupling a PromptDialogFragment with it's PromptRequest ensures any action
consuming a PromptDialogFragment will always consume the PromptRequest for
which that dialog was shown irrespective of the number of prompts or which is
currently shown on top.
mergify bot pushed a commit that referenced this issue Jun 2, 2021
This try-catch was added in #6687 as an effort to better individualize prompt
cast exceptions in our crash reporting platforms to better asses their
frequency and hopefully get more data to debug and fix the underlying issue.

The original issue is resolved in the first commit of this patch so there is no
need to keep the try-catch.
grigoryk pushed a commit to gabrielluong/android-components that referenced this issue Sep 11, 2021
Following crash reports it was seen that it is possible for multiple prompts to
be shown at the same time with an edgecase being that one prompt request comes
after the user interacted with a previous prompt but before the consume call
completing in AC / GV time at which this code will try to use the new prompt,
not the one the user interacted with.

Having support for multiple prompt requests in ContentState and tightly
coupling a PromptDialogFragment with it's PromptRequest ensures any action
consuming a PromptDialogFragment will always consume the PromptRequest for
which that dialog was shown irrespective of the number of prompts or which is
currently shown on top.
grigoryk pushed a commit to gabrielluong/android-components that referenced this issue Sep 11, 2021
This try-catch was added in mozilla-mobile#6687 as an effort to better individualize prompt
cast exceptions in our crash reporting platforms to better asses their
frequency and hopefully get more data to debug and fix the underlying issue.

The original issue is resolved in the first commit of this patch so there is no
need to keep the try-catch.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working <prompts> Component: feature-prompts
Projects
None yet
Development

No branches or pull requests

3 participants