-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Notion] updated page trigger improvements #14131
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThe pull request introduces updates to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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: 6
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- components/notion/package.json (1 hunks)
- components/notion/sources/updated-page/updated-page.mjs (6 hunks)
🔇 Additional comments (2)
components/notion/sources/updated-page/updated-page.mjs (2)
155-155
: Check compatibility ofstructuredClone
The
structuredClone
function is relatively new and may not be supported in all Node.js environments. Verify that your runtime environment supportsstructuredClone
or consider using an alternative for deep cloning.You can check your Node.js version:
If the version is below 17.0.0, you can use a polyfill or a library like
lodash.cloneDeep
:npm install lodashAnd update the code:
import _ from "lodash"; const previousValue = _.cloneDeep(propertyValues[page.id]?.[propertyName]);
150-152
: Verify the loop termination condition for correctnessThe condition to break the loop may cause some updated pages to be skipped:
if (lastCheckedTimestamp > Date.parse(page.last_edited_time)) { break; }This could exit the loop before processing all relevant pages. Ensure that pages are sorted in descending order of
last_edited_time
so that this condition works as intended.Confirm that the pages are correctly sorted:
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.
LGTM!
changes
array that exports the previous and the current valuesSummary by CodeRabbit
New Features
includeNewPages
for event emissions related to newly created pages.Improvements