Open lanitochka17 opened 3 weeks ago
Triggered auto assignment to @sonialiap (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@sonialiap FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Job added to Upwork: https://www.upwork.com/jobs/~017e8abcd538b6fd27
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr (External
)
The preview image of a shared expense only loads if the user opens the expense and then navigates back. The preview image should be available immediately after sharing the expense.
The root cause of the issue is due to the image loading mechanism not being triggered correctly when the expense is initially shared. The image loader isn't fetching the image until the expense detail is opened and the view is refreshed.
To solve this problem, we need to ensure that the image loading mechanism is triggered immediately when the expense is shared. To achieve this, we should -
Trigger Image Load on Sharing:
Ensure that the image loader is called when the expense is shared, updating the preview image in the list without needing to open and go back.
// Example logic to trigger image load on sharing
function shareExpense(expenseId, workspaceId) {
shareExpenseWithWorkspace(expenseId, workspaceId)
.then(() => {
loadImagePreview(expenseId); // Trigger image load
})
.catch(error => {
console.error("Error sharing expense:", error);
});
}
function loadImagePreview(expenseId) { // Logic to load and update image preview const previewImage = getExpensePreviewImage(expenseId); updatePreviewImageState(expenseId, previewImage); }
Update State Management:
Make sure the state reflecting the preview image is updated promptly when the sharing action is completed.
function updatePreviewImageState(expenseId, image) {
// Logic to update state with the new image
setState(prevState => ({
...prevState,
expenses: prevState.expenses.map(expense =>
expense.id === expenseId ? {...expense, previewImage: image} : expense
)
}));
}
Preload Images:
The root cause of the issue is due to the image loading mechanism not being triggered correctly when the expense is initially shared.
@TheGithubDev Could you be more specific about where the issue is and where we need to apply the changes?
@sonialiap, @mollfpr Eep! 4 days overdue now. Issues have feelings too...
Not overdue. Waiting for the contributor and new proposals.
@mollfpr Thanks for your feedback!
Specific Issue Location: The issue lies within the image loading mechanism that handles the preview images of shared expenses. Currently, this mechanism is not triggered until the user opens the expense detail view and then navigates back. As a result, the preview image does not load immediately upon sharing the expense.
Specific Changes Required:
Trigger Image Load on Sharing: Location: The function responsible for sharing the expense, located in the expense sharing service. Change: Modify this function to include a call to the image loading mechanism immediately after the expense is successfully shared.
// Example logic to trigger image load on sharing
function shareExpense(expenseId, workspaceId) {
shareExpenseWithWorkspace(expenseId, workspaceId)
.then(() => {
loadImagePreview(expenseId); // Trigger image load
})
.catch(error => {
console.error("Error sharing expense:", error);
});
}
function loadImagePreview(expenseId) {
// Logic to load and update image preview
const previewImage = getExpensePreviewImage(expenseId);
updatePreviewImageState(expenseId, previewImage);
}
Update State Management: Location: The component that manages the state of the expenses list, within the React state. Change: Ensure that the state is updated promptly with the new preview image once it has been loaded.
function updatePreviewImageState(expenseId, image) {
// Logic to update state with the new image
setState(prevState => ({
...prevState,
expenses: prevState.expenses.map(expense =>
expense.id === expenseId ? {...expense, previewImage: image} : expense
)
}));
}
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@TheGithubDev I understand what you're trying to achieve but I don't see the RCA pointing to the correct root cause. Could you be more specific where do we need to implement the changes?
@sonialiap, @mollfpr Eep! 4 days overdue now. Issues have feelings too...
@TheGithubDev if you're still interested in working on this, would love to hear your thoughts on where we would need to implement this change? (bumping mollfpr's question https://github.com/Expensify/App/issues/43579#issuecomment-2179257630)
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@sonialiap @mollfpr this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@sonialiap, @mollfpr Still overdue 6 days?! Let's take care of this!
No new proposals.
@sonialiap, @mollfpr Huh... This is 4 days overdue. Who can take care of this?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@sonialiap, @mollfpr Still overdue 6 days?! Let's take care of this!
Still no new proposals.
@sonialiap, @mollfpr Whoops! This issue is 2 days overdue. Let's get this updated quick!
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.82-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4624340&group_by=cases:section_id&group_id=309130&group_order=asc Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Preview image should be available immediately
Actual Result:
Preview image of the shared expense only loads if you open the expense and go back
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/f0335bf0-f507-4895-b0e2-fab42b47297f
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mollfpr