Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Use oldPolicyName report field for archived workspace chats #8436
Use oldPolicyName report field for archived workspace chats #8436
Changes from 36 commits
d6b2c65
e5b8028
511fbf6
67ba2da
8b59413
e0c5cc8
a477ed5
9e180a6
1a56e03
a1672dd
7238931
d04277f
1877d26
6c362cc
2076984
3c744a5
4704ced
6defc76
9aed0a3
e47974a
76b6df2
49c4845
92cb76b
9b23765
7059036
4d559a8
95fcc40
dc210f6
5c7bca7
fa54389
fe02dc7
32a7c2c
f2a6559
4ed0a29
f9b304d
83b6cc9
58b9bd6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This is a random fix, but this code makes it look like theoretically we could have
MERGED_1
orMERGED_2
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.
question: Do archived room and "own policy expense chats" not have
reportName
?Just wondering because the previous logic implies that if we have those types we'll use the
oldPolicyName
but don't really imply there's noreportName
at all. We can't tell which things would have report names and others wouldn't.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.
Good question – this probably needs to be cleaned up. The
reportName
for archived "own PolicyExpenseChat" is just(archived)
, which surely will lead to unexpected behavior (such as the sidebar bug I am seeing). I think if we update this to make sure thereportName
is correct in Onyx, then we could just use that here directly instead ofoldPolicyName
.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.
There's a lot of overlap between
getChatReportName
andReportUtils.getTitle
.I think I'll refactor this to:
ReportUtils.getTitle
toReportUtils.getReportName
.ReportUtils.getReportName
to add separate tests for user-created policy rooms and default policy rooms.getChatReportName
and useReportUtils.getReportName
instead.reportName
in Onyx directly instead of usingReportUtils.getReportName
.Does that sound like a good plan?
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.
That makes sense to me. But I also curious if we can provide the correct
reportName
via the server. Why do these reports have names that are not the actual name we want to show... 🤔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.
So I did a fair amount of research into what it would look like to generate the
reportName
for chat reports via the server, and I don't think it's a good idea. Report titles are generated from a variety of sources / pieces of information:The server can do all the logic to generate the correct title using information from the current user, report, policy, and personalDetails. But if we do that we lose all the benefits of "live" Pusher data.
- i.e: if report titles are generated only on the server and a report participant updates their personal details, you would only see that change if you refresh the page or fetch the report again.
- If report titles are generated on the front-end, then you would see that changes as soon as the personal details for that user update (currently we don't have a Pusher channel for personal details, but hopefully we will soon).
Does that make sense?
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.
Honestly kept going back and forth on this, so I posted in slack here
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.
Circling back on this, we determined that we should generate report titles on the client. Furthermore, since the value is a composite of several server-generated values that can be set up with Pusher, I don't want to save the composite value in Onyx.
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.
Yeah it all makes sense. I guess a counter to the approach is that if the server is supposed to be pushing changes directly to Onyx (a la Optimized API) then maybe a change to personal details could also send out updates about report names. But doesn't seem like there is a ton of clear value in doing that.