-
Notifications
You must be signed in to change notification settings - Fork 218
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
fix: Slack notification not sent on page update #8841
fix: Slack notification not sent on page update #8841
Conversation
|
@@ -168,7 +169,7 @@ | |||
options.grant = grant; | |||
options.userRelatedGrantUserGroupIds = userRelatedGrantUserGroupIds; | |||
} | |||
const previousRevision = await Revision.findById(revisionId); | |||
previousRevision = await Revision.findById<IRevisionHasId>(revisionId); |
Check failure
Code scanning / CodeQL
Database query built from user-controlled sources High
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.
この failure はちゃんと消えるような実装をしてください
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.
xss.process() を使ってサニタイズしたものを渡すように改修しました
@@ -68,6 +68,7 @@ declare global { | |||
export type SaveOptions = { | |||
wip: boolean, | |||
slackChannels: string, | |||
isSlackEnabled: boolean, |
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.
if (isSlackEnabled) { | ||
try { | ||
const option = revisionId != null ? { previousRevision: revisionId } : undefined; | ||
const option = previousRevision != null ? { previousRevision } : undefined; |
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.
crowi.userNotificationService.fire() の第5引数には IRevisionHasId 相当の値のオブジェクトを渡すように改修 (v6踏襲)
参考
growi/apps/app/src/server/routes/page.js
Line 536 in 41c32d5
const results = await userNotificationService.fire(page, req.user, slackChannels, 'update', { previousRevision }); |
@@ -25,6 +25,10 @@ const prepareAttachmentTextForCreate = function(page, siteUrl) { | |||
}; | |||
|
|||
const prepareAttachmentTextForUpdate = function(page, siteUrl, previousRevision) { | |||
if (previousRevision == null) { | |||
return; | |||
} |
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.
少しでも type safe に近づくように、jsdoc で previousRevision の型だけでも明示するようにしてください
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.
追加しました
@@ -168,7 +169,7 @@ | |||
options.grant = grant; | |||
options.userRelatedGrantUserGroupIds = userRelatedGrantUserGroupIds; | |||
} | |||
const previousRevision = await Revision.findById(revisionId); | |||
previousRevision = await Revision.findById<IRevisionHasId>(revisionId); |
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.
この failure はちゃんと消えるような実装をしてください
This reverts commit c4510d9.
reg-suit detected visual differences. Check this report, and review them. 🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴 🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵 What do the circles mean?The number of circles represent the number of changed images.🔴 : Changed items, ⚪ : New items, ⚫ : Deleted items, and 🔵 Passed items How can I change the check status?If reviewers approve this PR, the reg context status will be green automatically. |
Tasks
#146960 [v7] slack 連携した slack に対して wiki からの通知が飛ばない件の修正
┗ #146980 修正