-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Remove extra concierge CreateChatReport call #8340
Conversation
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.
We should actually merge a simplified object here:
// Merge report into Onyx
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${data.reportID}`, {reportID: data.reportID});
Instead of merging an object with just the ID - we should merge the full report like so
// Merge report into Onyx
const simplifiedReport = getSimplifiedReportObject(data);
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${data.reportID}`, simplifiedReport);
80bcfbe
to
8868ad2
Compare
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.
Change looks fine to me.
I am curious about why we started returning the reportSummaryList
from CreateChatReport
and left some thoughts here.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @roryabraham in version: 1.1.51-0 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.1.51-0 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.1.51-0 🚀
|
cc @kidroca
Details
This line was always being executed because
isConciergeChatReport
was always returningfalse
for each of the returned reports.The returned reports are either:
fetchChatReportsByIDs
, which was previously returning a report summary and not a simplified report object (i.e: did not containparticipants
).fetchOrCreateChatReport
, which until recently didn't return anything but a status code in an array.Now both functions return an array of simplified report objects.
I went through and reviewed all the places where the return values of those functions are used to verify that this change was safe. Fortunately the list of usages is pretty small:
fetchChatReportsByIDs
reportID
is being used.reportID
is being used.fetchOrCreateChatReport
This one is only used here which works for the same reasons that
fetchChatReportsByIDs
works.Fixed Issues
$ #7861
Tests / QA Steps
api?command=CreateChatReport
where the participants are just you and concierge.PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followed/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Screenshots