Repository navigation
Closed
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.DailyKSv2KSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
Description
Problem
As described in the parent issue, we currently do not support optimistic report name computation for several formula parts referencing basic report fields. These parts are listed below.
{report:id} – Base62 report ID
{report:status} – Report status
{report:expensescount} – Number of expenses in report
Solution
Please add support for these report formula parts in the optimistic computation within App.
Here is the current back-end C++ implementation, which you will likely find useful for proposals.
report:id
if (partName == "id") {
return Report::formatIDAsBase62(reportID);
}
string Report::formatIDAsBase62(int64_t id)
{
string base62 = Num::asBase62String(id);
string padding(11 - base62.size(), '0');
return 'R' + padding + base62;
}
string Num::asBase62String(int64_t from)
{
if (from < 0) {
throw out_of_range("Negative values not supported");
}
string result = "00000000000";
size_t ptr = 10;
while (from) {
result[ptr--] = base62alphabet[from % 62];
from /= 62;
}
for (ptr = 0; ptr < 10; ptr++) {
if (result[ptr] != '0') {
break;
}
}
return result.substr(ptr);
}
const char* Num::base62alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";report:status
if (partName == "status") {
const Report::statuses status = static_cast<Report::statuses>(reportJSON.getIntMemberWithDefault("status"));
return Report::STATUSES[status];
}
const char* Report::STATUSES[Report::STATUS_NUM_STATUSES] = {
"Open",
"Processing",
"Archived",
"Approved",
"Reimbursed",
};report:expensescount
I have created an internal issue to start returning this field to NewDot. We will return the transactions count field to Onyx and then App needs to optimistically update this field whenever a transaction is added, deleted, or moved away from a report.
if (partName == "expensescount") {
return to_string(reportJSON.getIntMemberWithDefault("transactionCount"));
}Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021957525358844302093
- Upwork Job ID: 1957525358844302093
- Last Price Increase: 2025-09-11
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @strepanier03Metadata
Metadata
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.DailyKSv2KSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
Type
Projects
- StatusShow more project fieldsDone
Activity
[-]Add more report fields for optimistic report names[/-][+][$250] Add more report fields for optimistic report names[/+]melvin-bot commentedon Aug 18, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021957525358844302093
melvin-bot commentedon Aug 18, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (
External)lorretheboy commentedon Aug 18, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Add more report fields for optimistic report names
What is the root cause of that problem?
Improvement
What changes do you think we should make in order to solve the problem?
Add new util functions (May have some minor update/optimization during PR phase)
Add new handler here
App/src/libs/Formula.ts
Lines 243 to 261 in 869b6ad
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add new test cases in
FormulaTest.tsWhat alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
elizhabiboullah commentedon Aug 18, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Report titles that use formula fields are only partially supported by the offline-first optimistic name generator
What is the root cause of that problem?
Improvement
What changes do you think we should make in order to solve the problem?
Add placeholder support in
App/src/libs/ReportUtils.ts
Line 6009 in fa220bd
{report:id}-> UseApp/src/libs/getBase62ReportID.ts
Line 8 in fa220bd
{report:expensescount}-> Count non-deleted report transactions via existing report → transactions helpers{report:reimbursable}/{report:nonreimbursable}-> UseApp/src/libs/ReportUtils.ts
Line 3732 in fa220bd
convertToDisplayString(amount, report.currency)App/src/libs/CurrencyUtils.ts
Line 108 in fa220bd
the title field source is already wired
getTitleReportField()App/src/libs/ReportUtils.ts
Lines 3871 to 3873 in fa220bd
getReportFieldsByPolicyID()App/src/libs/ReportUtils.ts
Lines 3895 to 3897 in fa220bd
are used when building optimistic expense reports and empty reports:
App/src/libs/ReportUtils.ts
Line 6171 in fa220bd
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
github-actions commentedon Aug 18, 2025
sofi-a commentedon Aug 18, 2025
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
72 remaining items
melvin-bot commentedon Nov 27, 2025
@parasharrajat 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
melvin-bot commentedon Dec 3, 2025
@parasharrajat Eep! 4 days overdue now. Issues have feelings too...
strepanier03 commentedon Dec 4, 2025
Payment summary
strepanier03 commentedon Dec 4, 2025
I paid the Upwork contract and closed it. Closing GH now since paying via Newdot is the last step.
parasharrajat commentedon Dec 19, 2025
Payment requested as per #68695 (comment)
twisterdotcom commentedon Dec 19, 2025
@parasharrajat has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-ccb9-a5c5-830b-d21ca757a244