Quick tapping crashes MaterialSnackbar
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- android, csharp
- 领域
- mobile-dev
调研方向
查找 MaterialSnackbar 的构造函数和 InputTaskCompletionSource,然后在所述条件下重现 Android 上对 ActionButton.Command 的快速调用。验证重复点击能够完成 snackbar,且不会引发 InvalidOperationException 或导致崩溃;issue 中未指定具体文件或测试。
由索引模型根据 Issue 内容生成。
描述
🐛 Bug Report
If the UI thread is busy, or a weak device is used, then it becomes possible to call ActionButton.Command multiple times with quick clicks, as a result, after the second pressing InputTaskCompletionSource?.SetResult throws an exception
Is there any reason not to use TrySetResult ?
internal MaterialSnackbar(string message, string actionButtonText, int msDuration = DurationLong, MaterialSnackbarConfiguration configuration = null)
{
...
var primaryActionCommand = new Command(async () =>
{
_primaryActionRunning = true;
await DismissAsync();
InputTaskCompletionSource?.TrySetResult(true);
}, () => !_primaryActionRunning);
...
}
Stack trace
XF.Material.Forms.UI.Dialogs.MaterialSnackbar.<.ctor>b__6_0 () [0x0007a] in <3cfa98f1ecd344d8b7c2286276967650>:0;XF.Material.Forms.UI.Dialogs.MaterialSnackbar
TaskCompletionSource`1[TResult].SetResult (TResult result)
<.ctor>b__6_0 ()
AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state)
SyncContext+<>c__DisplayClass2_0.<Post>b__0 ()
Thread+RunnableImplementor.Run ()
IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this)
Reason
System.InvalidOperationException: System.InvalidOperationException
Expected behavior
The app should not crash
Reproduction steps
Configuration
Version: 1.x
Platform:
- 📱 iOS
- 🤖 Android
- 🏁 WPF
- 🌎 UWP
- 🍎 MacOS
- 📺 tvOS
- 🐒 Xamarin.Forms
- 主要语言
- C#
- 星标
- 631
- 派生
- 150
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Baseflow/XF-Material-Library 的其他 Issue
-
难度 5/5 一周以上 新手友好度 20/100
Baseflow/XF-Material-Library#458 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 50/100
Baseflow/XF-Material-Library#457 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 48/100
Baseflow/XF-Material-Library#456 ·
-
难度 3/5 1-2 天 新手友好度 35/100
Baseflow/XF-Material-Library#454 ·
-
难度 1/5 1 小时以内 新手友好度 58/100
Baseflow/XF-Material-Library#453 ·
查看 Baseflow/XF-Material-Library 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
MicrosoftLearning/PL-400_Microsoft-Power-Platform-Developer#231 ·
-
难度 2/5 1-3 小时 新手友好度 66/100
joinrpg/joinrpg-net#5313 ·
维护者通常 1 天内回复
-
[12.x] FixIncorrectOwnerIdRelationships can delete legitimate library roots when UserView shares the same path可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复