AOSSIE-Org / AOSSIE-Org/SocialShareButton
[BUG]: Prevent false-positive share success events in Discord fallback
- Ngôn ngữ chính
- TypeScript
- Star
- 25
- Fork
- 65
- Merge trung bình
- 2 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
### Bug Description
## Description
The current Discord fallback share flow emits `social_share_success` and triggers the `onShare` callback immediately after calling `copyLink()` and `window.open()`.
If clipboard access fails or the popup is blocked by the browser, the library can still report a successful share even though the fallback action did not complete successfully.
## Expected Behavior
Only emit `social_share_success` and invoke `onShare` after confirming that the fallback action has completed successfully.
## Possible Solution
- Return a success/failure result from `copyLink()`.
- Verify that `window.open()` succeeds.
- Emit the success event only when the fallback action completes successfully.
I'd be happy to work on this Issue
### Steps to Reproduce
_No response_
### Logs and Screenshots
_No response_
### Environment Details
_No response_
### Impact
Critical - Application is unusable
### Code of Conduct
- [x] I agree to follow the Code of Conduct
- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates
Hướng dẫn đóng góp
Hướng nghiên cứu
Start by locating the TypeScript Discord fallback and its copyLink() and window.open() call sites. Trace how their outcomes reach social_share_success and onShare, then validate both success and failure paths with the repository’s existing test setup; done means neither callback nor event fires when clipboard access or the popup fails.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- frontend
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100