Expensify Bug Fix Scan And Manual Expenses Not Moving To New Reports

by StackCamp Team 69 views

Hey guys! 👋 Today, we're diving deep into a peculiar issue in Expensify that's been causing a bit of a stir: expenses not moving to new reports as expected. This can be super frustrating, especially when you're trying to keep your finances organized. So, let's break down what's happening, why it's happening, and what you can do about it.

Understanding the Issue: Expenses Stuck in Limbo

So, what's the deal? Users are reporting that when they create expenses, either manually or by scanning receipts, these expenses sometimes fail to transfer to new reports. Instead, they might encounter infinite loading screens, empty reports, or the expenses might just bounce back to the user's self DM. It's like the expenses are stuck in limbo, which is definitely not where we want our financial data to be! 😬

This issue was first identified in version v9.2.28-0 and has been observed in both staging and production environments. The problem seems to affect both manual and scanned expenses, although there are some inconsistencies in the behavior. For manual expenses, users are experiencing infinite loading screens, while scanned expenses sometimes end up in empty reports. What's even weirder is that after a reset and refresh, these expenses might reappear in the self DM, as if nothing ever happened. 👻

The core problem lies in the expense creation and reporting process. When a user creates a manual or scanned expense and tries to submit it to a workspace, the expectation is that the expense will be added to a new report within that workspace. This new report should then be accessible through the workspace chat, making it easy for users to track and manage their expenses. However, the bug disrupts this flow, leading to expenses being misplaced or inaccessible.

The inconsistency in the behavior, with both infinite loading screens and expenses ending up in empty reports, suggests that there might be multiple underlying causes at play. It could be related to issues in the data synchronization between the app and the server, problems with the report creation logic, or even network connectivity issues that disrupt the transfer process. This complexity makes it crucial to dive deep into the system logs and debug the specific steps leading up to the failure to pinpoint the exact cause.

Steps to Reproduce the Bug: Let's Recreate the Chaos

If you're the type who likes to get their hands dirty and try to reproduce a bug (or maybe you're a QA tester!), here's a step-by-step guide to recreate the issue:

  1. Set the Stage: Create a new Expensify account with a Gmail address and select "Track and budget expenses" as your intent. Make sure you have at least one workspace set up, and that both personal and group policy auto-reporting are turned off. Think of it as setting the scene for our bug to make its grand entrance. 🎭
  2. Go to Staging: Head over to staging.new.expensify.com. This is where we test things out before they go live, so it's the perfect place to hunt for bugs. 🐛
  3. Create a Manual Expense: Click the FAB (that little plus button), then choose "Create expense" and select "Manual". This is where we'll start our journey into expense-tracking troubles.
  4. Verify Report Field: Make sure the Report field is set to "None". This is our control variable, ensuring we're starting from a clean slate.
  5. Create the Expense: Go ahead and fill out the expense details and create it. You're one step closer to bug-discovery!
  6. Check Self DM: Verify that the expense is created in your self DM report. This is the expected behavior up to this point.
  7. Submit it to Someone: In your self DM, click "Submit it to someone". This is where things start to get interesting.
  8. Select Workspace: Choose your workspace and create the expense. This is the critical step where the bug usually manifests itself.
  9. Repeat for Scan: Now, repeat steps 2-7, but this time, choose "Scan" in step 2 to create an expense by scanning a receipt. This will help us see if the issue affects both manual and scanned expenses.

If you follow these steps, you should be able to reproduce the issue. For manual expenses, you'll likely encounter an infinite loading screen after step 8 when trying to access the report thread. For scanned expenses, the new report might be empty, or sometimes, the expense might move successfully. It's a bit unpredictable, which is what makes this bug so intriguing. 🤔

Expected vs. Actual Results: A Tale of Two Outcomes

So, what should happen, and what's actually happening? Let's break it down:

  • Expected Result: When you create an expense (manual or scanned) and submit it to a workspace, the expense should be added to a new report. This report should then be easily accessible through the workspace chat, making it a breeze to manage your expenses. 😌
  • Actual Result: Instead, we're seeing a few different scenarios:
    • Manual Expense: After submitting a manual expense to a workspace, you might encounter an infinite loading screen when trying to access the report thread. It's like the app is stuck in a never-ending loop. 🔄
    • Scanned Expense: For scanned expenses, the new report might be empty. The expense seems to vanish into thin air. 💨
    • The Return of the Expense: Sometimes, after a reset and refresh, the expenses reappear in the self DM, as if they never left. It's like they're playing hide-and-seek. 🙈

The discrepancy between the expected and actual results highlights the severity of the issue. Users rely on Expensify to accurately track and report expenses, and when expenses are misplaced or inaccessible, it can lead to frustration and potential financial errors. This is why it's crucial to get this bug squashed ASAP! 🐛🔨

The Impact Across Platforms: A Widespread Issue

This bug isn't picky; it's affecting users across a variety of platforms. Here's a rundown of where the issue has been observed:

  • Android: Both the app and mWeb Chrome on Android devices are affected. 📱
  • iOS: The app, mWeb Safari, and mWeb Chrome on iOS devices are all experiencing the issue. 🍎
  • Windows: Chrome on Windows is also showing the bug. 💻

Currently, there's no confirmation on whether MacOS (Chrome/Safari) or the MacOS desktop app are affected. However, the widespread nature of the bug suggests that it's a systemic issue rather than platform-specific. This means that the underlying cause is likely in the core logic of the app, rather than in platform-specific code. This makes it even more important to find and fix the root cause to ensure a consistent experience for all users. 🌐

Screenshots and Videos: Seeing is Believing

To help visualize the issue, the Applause Internal Team has provided a helpful screenshot and video that demonstrate the bug in action. This visual evidence can be invaluable for developers trying to understand and fix the problem. It's one thing to read about a bug, but seeing it happen firsthand can provide crucial context and insights. 🖼️🎬

The provided screenshot and video show the infinite loading screen and the empty report issues. This visual confirmation helps developers understand the exact user experience and the points of failure in the process. The visual representation of the bug often triggers new ideas and perspectives, which can be essential in the debugging and resolution process.

You can check out the visual evidence here: https://github.com/user-attachments/assets/f73627dd-0ca3-4708-8110-6aed5a5ffb61

The Hunt for a Workaround: Is There a Temporary Fix?

As of now, there's no known workaround for this bug. This means that users who encounter the issue are essentially stuck, unable to properly submit their expenses to reports. This lack of a workaround makes it even more critical to find a permanent solution as quickly as possible. In the meantime, users may need to resort to manual methods of tracking and reporting expenses, which can be time-consuming and error-prone. ⏳

Conclusion: Let's Get This Bug Squashed!

So, there you have it, guys! We've explored the issue of expenses not moving to new reports in Expensify. We've seen how it affects both manual and scanned expenses, across multiple platforms. We've even tried to reproduce the bug ourselves. It's clear that this is a significant issue that needs to be addressed. 💪

Hopefully, by shining a light on this bug, we can help the Expensify team find a solution and get things back on track. In the meantime, stay tuned for updates, and if you encounter this issue yourself, be sure to report it! Together, we can make Expensify even better. 🙌

View all open jobs on GitHub