Expensify: USD Displayed For Empty Reports - Bug Report

by Admin 56 views
Expensify Bug: USD Displayed in Total Spend for Empty Reports

Hey guys! Let's dive into a quirky bug we've found in Expensify. It seems like when you select an empty report, the total spend is displayed in USD, which isn't quite right. Let's break down the issue, how to reproduce it, and what we expect to see.

Issue Overview

So, the main issue here is that when an empty report is selected in Expensify, the total spend is incorrectly shown in USD instead of the workspace currency. This can be confusing for users who are expecting to see the currency they've set for their workspace. This issue affects multiple platforms, including Android, iOS, and MacOS, so it's pretty widespread.

Why is this important? Accurate currency display is crucial for financial tracking and reporting. When users see the wrong currency, it can lead to misunderstandings, errors in budgeting, and general frustration with the platform. We want Expensify to be as smooth and reliable as possible, so fixing this bug is a priority.

Bug Report Details

Here’s a detailed breakdown of the bug:

Discussion Category: Expensify App

App: Expensify

Version Number: 9.2.46-0

Reproducible in Staging?: Yes

Reproducible in Production?: Yes

Regression Test Link: https://github.com/Expensify/App/pull/70877

Tester Email: jsnoidjdosisjdios@gmail.com

Reported By: Applause Internal Team

Device Used: Mac 15.5 / Chrome

App Component: Search

Steps to Reproduce

To see this bug in action, follow these simple steps:

  1. Head over to staging.new.expensify.com. This is our testing environment, so you won't mess with the live data.
  2. Navigate to a workspace chat. This is where reports are typically created and managed.
  3. Create a new, empty report. This is the key step, as the issue occurs with reports that have no transactions.
  4. Go to Reports > Reports. This will take you to the main reports listing.
  5. Select the empty report you just created. Now, watch what happens with the total spend display!

Expected vs. Actual Result

Expected Result: The total spend should be displayed in the workspace currency. If your workspace is set to EUR, you should see EUR; if it’s set to GBP, you should see GBP, and so on.

Actual Result: The total spend is incorrectly shown in USD, regardless of the workspace currency settings. This is the heart of the bug we’re addressing.

Workaround

Unfortunately, there’s currently no known workaround for this issue. Users will simply see the incorrect currency until the bug is fixed. This makes it even more important to get this resolved quickly to avoid confusion and potential errors.

Platform Impact

This bug affects a wide range of platforms, which means a lot of users could be encountering it. Here’s a rundown of the affected platforms:

  • [x] Android: App
  • [x] Android: mWeb Chrome
  • [x] iOS: App
  • [x] iOS: mWeb Safari
  • [x] iOS: mWeb Chrome
  • [ ] Windows: Chrome
  • [x] MacOS: Chrome / Safari
  • [x] MacOS: Desktop

As you can see, it’s pretty comprehensive, hitting both mobile and desktop environments. The only platform not marked is Windows Chrome, but it’s still something to keep in mind during testing.

Visual Evidence

To help illustrate the issue, here’s a screenshot/video:

https://github.com/user-attachments/assets/c6e13c38-3b18-4bd4-9675-0c9e45555ec2

This visual aid makes it super clear what’s going on. You can see the incorrect USD display right there.

Contributing and Getting Help

If you’re interested in contributing to Expensify or want to learn more about how you can help, check out our contributing guidelines here. We’ve got a great community and welcome new contributors!

For any questions or to join our Slack channel, email us at contributors@expensify.com. We’re always happy to help and get more people involved.

Open Jobs on GitHub

Want to see what else we’re working on? Check out all the open jobs on GitHub here. There are plenty of opportunities to contribute and make a difference.

Deep Dive into the Issue

Let's get into the nitty-gritty of this bug. We've established that the total spend in empty reports is showing up in USD instead of the correct workspace currency. But why is this happening? To really nail down the fix, we need to understand the root cause. This means diving into the codebase and tracing where the currency is being set and how it's being displayed.

One potential area to investigate is the reporting logic. When a report is generated, especially an empty one, the system might be defaulting to a base currency (which seems to be USD in this case) instead of correctly pulling the workspace settings. This could be due to a conditional statement that isn't properly handling empty reports, or it could be an issue with how the currency is being initialized.

Another aspect to consider is the data handling. Are the report details, including the workspace currency, being correctly passed from the backend to the frontend? If the frontend isn't receiving the correct currency information, it will obviously display the wrong one. This means we might need to check the API endpoints and the data structures being used.

Technical Investigation

To really dig into this, a developer would likely need to:

  1. Review the Code: Look at the components responsible for displaying report totals and see how they fetch and display currency.
  2. Check the API: Examine the API calls that retrieve report data to ensure the correct currency is being returned.
  3. Debug the Logic: Use debugging tools to step through the code and see where the currency is being set.
  4. Test Edge Cases: Create various scenarios, including different workspace currencies and empty reports, to see if the issue persists.

Potential Fixes

Based on our initial assessment, here are a few potential fixes we can explore:

  • Correct the Default Currency: Ensure that the default currency is correctly set to the workspace currency when a report is created.
  • Improve Data Handling: Verify that the report details, including the currency, are being correctly passed from the backend to the frontend.
  • Update Conditional Logic: Review the conditional statements in the code to ensure they correctly handle empty reports.

Community Contributions

We love when the community gets involved! If you're a developer and want to contribute to fixing this bug, here are some ways you can help:

  • Fork the Repository: Create your own copy of the Expensify app repository.
  • Investigate the Code: Dive into the codebase and try to identify the root cause of the issue.
  • Submit a Pull Request: If you find a fix, submit a pull request with your changes.
  • Provide Feedback: If you have any insights or suggestions, share them with the team.

By working together, we can make Expensify even better!

Conclusion

So, there you have it, guys! A comprehensive look at the USD display bug in Expensify for empty reports. We've covered the issue, how to reproduce it, the expected and actual results, and even some potential fixes. This bug affects a wide range of platforms and can cause confusion for users, so it’s important to get it resolved. We encourage developers in the community to jump in and help us squash this bug. Let's make Expensify the best it can be!