-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
The system automatically updates the time, resulting in event loss #13494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ausing registered listeners to become invalid When the system automatically updates the time to the time before assigning the value to 'invoker. attached', 'e.vts<=invoker. attached' will cause the function to always jump out, resulting in listening failure
WalkthroughThe code replaces all instances of Changes
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/runtime-dom/src/modules/events.ts (1)
86-92
: Adopt monotonic timer for invoker attachment timestamps
The newgetNow
correctly usesperformance.now()
with a per-tick cache to replaceDate.now()
, ensuring monotonic behavior and reducing calls.Consider splitting the comma‐operator expression into two statements for clarity:
- const getNow = () => - cachedNow || (p.then(() => (cachedNow = 0)), (cachedNow = performance.now())) + const getNow = () => { + if (cachedNow) return cachedNow + p.then(() => { cachedNow = 0 }) + cachedNow = performance.now() + return cachedNow + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/runtime-dom/src/modules/events.ts
(2 hunks)
🔇 Additional comments (1)
packages/runtime-dom/src/modules/events.ts (1)
110-113
: Assign monotonic timestamps to events on first dispatch
ReplacingDate.now()
withperformance.now()
fore._vts
guarantees that event timestamps aren’t affected by system clock changes. Implementation is correct.
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
When the system automatically updates the time to the time before assigning the value to 'invoker. attached', 'e.vts<=invoker. attached' will cause the function to always jump out, resulting in listening failure
demo
Summary by CodeRabbit
Date.now()
toperformance.now()
for all event-related timing.