-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Microsoft Teams - pagination updates #18712
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 GitHub. 2 Skipped Deployments
|
WalkthroughUpdates Microsoft Teams package version and action/source versions. Refactors source base to use a configurable timestamp field and optional sorted pagination. Adjusts several sources to pass tsField and flags. Changes chat messages API to request descending order by createdDateTime. Adds documentation links to some source descriptions. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Source as Source (e.g., New Chat Message)
participant Base as Base (common)
participant App as MicrosoftTeams App
participant MSGraph as Microsoft Graph
User->>Source: Run trigger
Source->>Base: getTsField()
Base-->>Source: tsField (e.g., createdDateTime / lastModifiedDateTime)
Source->>Base: getNewPaginatedResources(fn, params, lastDate, tsField, isSorted?)
Base->>App: fn(params) // paginated fetch
App->>MSGraph: GET resources (may include $orderby when applicable)
MSGraph-->>App: Page of resources
App-->>Base: Resources page
loop For each resource
Base->>Base: isNew(resource[tsField], lastDate)
alt New
Base-->>Source: Yield resource
Base->>Base: Update lastDate
else Not new
opt If isSorted
Base->>Base: Break iteration
end
end
end
Base-->>Source: Done
Source->>Base: _setLastDate(lastDate)
sequenceDiagram
autonumber
participant App as MicrosoftTeams App
participant MSGraph as Microsoft Graph
App->>MSGraph: GET /chats/{chatId}/messages?$orderby=createdDateTime desc
MSGraph-->>App: Messages (latest first)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
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: 2
🧹 Nitpick comments (3)
components/microsoft_teams/sources/common/base.mjs (2)
31-44
: Minor: clarify isSorted semanticsConsider renaming isSorted to isSortedDesc (or document) since you break on first non-new only when the list is sorted by tsField descending.
64-78
: Persist lastDate only when valid to prevent resetting stateIf no valid timestamps were processed, lastDate remains undefined; persisting undefined reprocesses all items next run.
Apply this diff:
- this._setLastDate(lastDate); + if (Number.isFinite(lastDate)) { + this._setLastDate(lastDate); + }components/microsoft_teams/microsoft_teams.app.mjs (1)
287-291
: Prefer SDK query params over inline query stringReplace the inline
$orderby
in the path with aparams
object:- async listChatMessages({ chatId }) { - return this.makeRequest({ - path: `/chats/${chatId}/messages?$orderby=createdDateTime%20desc`, - }); - }, + async listChatMessages({ chatId }) { + return this.makeRequest({ + path: `/chats/${chatId}/messages`, + params: { + orderby: "createdDateTime desc", + }, + }); + },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (14)
components/microsoft_teams/actions/create-channel/create-channel.mjs
(1 hunks)components/microsoft_teams/actions/list-channels/list-channels.mjs
(1 hunks)components/microsoft_teams/actions/list-shifts/list-shifts.mjs
(1 hunks)components/microsoft_teams/actions/send-channel-message/send-channel-message.mjs
(1 hunks)components/microsoft_teams/actions/send-chat-message/send-chat-message.mjs
(1 hunks)components/microsoft_teams/microsoft_teams.app.mjs
(1 hunks)components/microsoft_teams/package.json
(1 hunks)components/microsoft_teams/sources/common/base.mjs
(2 hunks)components/microsoft_teams/sources/new-channel-message/new-channel-message.mjs
(2 hunks)components/microsoft_teams/sources/new-channel/new-channel.mjs
(2 hunks)components/microsoft_teams/sources/new-chat-message/new-chat-message.mjs
(2 hunks)components/microsoft_teams/sources/new-chat/new-chat.mjs
(1 hunks)components/microsoft_teams/sources/new-team-member/new-team-member.mjs
(1 hunks)components/microsoft_teams/sources/new-team/new-team.mjs
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
components/microsoft_teams/sources/new-channel/new-channel.mjs (1)
components/microsoft_teams/sources/common/base.mjs (1)
tsField
(65-65)
components/microsoft_teams/sources/new-channel-message/new-channel-message.mjs (1)
components/microsoft_teams/sources/common/base.mjs (1)
tsField
(65-65)
components/microsoft_teams/sources/new-chat/new-chat.mjs (1)
components/microsoft_teams/sources/common/base.mjs (1)
tsField
(65-65)
components/microsoft_teams/sources/new-chat-message/new-chat-message.mjs (1)
components/microsoft_teams/sources/common/base.mjs (1)
tsField
(65-65)
components/microsoft_teams/sources/new-team/new-team.mjs (1)
components/microsoft_teams/sources/common/base.mjs (1)
tsField
(65-65)
components/microsoft_teams/sources/common/base.mjs (1)
components/microsoft_teams/sources/new-team-member/new-team-member.mjs (2)
resources
(39-39)meta
(41-41)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (18)
components/microsoft_teams/package.json (1)
3-3
: Version bump LGTMNo issues; aligns with action/source version updates in this PR.
components/microsoft_teams/actions/send-channel-message/send-channel-message.mjs (1)
8-8
: Version bump LGTMNo behavioral changes.
components/microsoft_teams/actions/send-chat-message/send-chat-message.mjs (1)
8-8
: Version bump LGTMNo behavioral changes.
components/microsoft_teams/actions/create-channel/create-channel.mjs (1)
8-8
: Version bump LGTMNo behavioral changes.
components/microsoft_teams/actions/list-channels/list-channels.mjs (1)
8-8
: Version bump LGTMNo behavioral changes.
components/microsoft_teams/actions/list-shifts/list-shifts.mjs (1)
8-8
: Version bump LGTMNo behavioral changes.
components/microsoft_teams/sources/new-team-member/new-team-member.mjs (1)
7-8
: LGTM! Metadata updates are consistent.The documentation link and version bump align with the broader refactoring effort across Microsoft Teams sources.
components/microsoft_teams/sources/new-chat-message/new-chat-message.mjs (2)
7-8
: LGTM! Metadata updates are consistent.Documentation link and version bump align with the PR's pagination updates.
22-31
: LGTM! Timestamp field support correctly implemented.The signature update to accept
tsField
and the sorting flag enable proper timestamp-based pagination for chat messages.components/microsoft_teams/sources/new-channel-message/new-channel-message.mjs (3)
7-8
: LGTM! Metadata updates are consistent.Documentation link and version bump align with the PR's pagination updates.
31-33
: LGTM! Semantic override for modification-based tracking.Overriding
getTsField()
to return"lastModifiedDateTime"
correctly signals that this source tracks updates rather than creation timestamps.
34-44
: LGTM! Parameter naming semantically matches the timestamp field.Using
lastUpdated
instead oflastCreated
appropriately reflects that this source trackslastModifiedDateTime
. The sorting flag and tsField propagation enable proper pagination.components/microsoft_teams/sources/new-team/new-team.mjs (2)
7-8
: LGTM! Metadata updates are consistent.Documentation link and version bump align with the PR's pagination updates.
13-19
: LGTM! Timestamp field support correctly implemented.The signature update to accept
tsField
enables proper timestamp-based pagination for teams.components/microsoft_teams/sources/new-channel/new-channel.mjs (2)
7-8
: LGTM! Metadata updates are consistent.Documentation link and version bump align with the PR's pagination updates.
22-30
: LGTM! Timestamp field support correctly implemented.The signature update to accept
tsField
enables proper timestamp-based pagination for channels.components/microsoft_teams/sources/new-chat/new-chat.mjs (2)
7-8
: LGTM! Metadata updates are consistent.Documentation link and version bump align with the PR's pagination updates.
13-19
: LGTM! Timestamp field support correctly implemented.The signature update to accept
tsField
enables proper timestamp-based pagination for chats.
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!
Hi everyone, all test cases are passed! Ready for release! Test report |
Follow-up to #18634
Addresses #18632
Summary by CodeRabbit
Bug Fixes
Documentation
Refactor
Chores