feat(messaging): implement optimistic updates with retry for failed messages
- Add pending/failed message status to track send state - Implement optimistic UI: show message immediately, update on server response - Add retry functionality for failed messages via tap-to-retry - Change send button from icon to text "发送" for clarity - Add MessageSendService with temp ID generation to prevent collisions feat(notification): add JPush notification deduplication and clear on tap - Deduplicate notificationArrived events from dual JPush/vendor channels - Clear all notifications on tap (QQ-style behavior) feat(post): add client-side idempotency key for post creation - Generate client_request_id per publish intent to prevent duplicates on retry - Pass idempotency key through to postService and voteService
This commit is contained in:
@@ -128,6 +128,13 @@ function NotificationBootstrap() {
|
||||
console.log('[NotificationBootstrap] JPush notification:', message.notificationEventType, message);
|
||||
if (message.notificationEventType !== 'notificationOpened') return;
|
||||
|
||||
// 点击任意一条通知即清除通知栏所有通知(与 QQ 一致:点一条清全部)
|
||||
// JPush 的 notificationOpened 在通知被点击时触发,此时清除系统通知栏中
|
||||
// 本应用的所有通知,避免用户需要逐条点击消除。
|
||||
systemNotificationService.clearAllNotifications().catch((error) => {
|
||||
console.warn('[NotificationBootstrap] clearAllNotifications failed:', error);
|
||||
});
|
||||
|
||||
const extras = message.extras || {};
|
||||
const notifType = extras.notification_type || message.notificationType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user