Clicking on an image in the email I received leads to a "Hmm... it's not here" page.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.73-0 Reproducible in staging?: Y Reproducible in production?: N If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @davidcardoza Slack conversation (hyperlinked to channel name): #quality
Action Performed:
- Send an image as user A to user B while user B is offline
- As user B, click image in email summary
Expected Result:
The image displayed without any issue
Actual Result:
hmm... it's not here message displayed
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- [ ] Android: Standalone
- [ ] Android: HybridApp
- [ ] Android: mWeb Chrome
- [ ] iOS: Standalone
- [ ] iOS: HybridApp
- [ ] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/3cd8c63b-c1fa-4af2-b903-70551fe1a429
https://github.com/user-attachments/assets/ed7822c1-3571-488a-99f5-ceb65322177e
Triggered auto assignment to @JmillsExpensify (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.
Triggered auto assignment to @mjasikowski (AutoAssignerNewDotQuality)
Triggered auto assignment to @dangrous (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
💬 A slack conversation has been started in #expensify-open-source
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
This also happens in prod. Demoting to NAB.
Hm this feels like it might be backend, but definitely open to a front end solve if we have one! Will look shortly
Trying to replicate locally, apparently it's hard to get the email summaries to send.
Trying to get some help replicating this, once i can we can figure out the solution
Okay so I managed to reproduce finally. The issue looks like the formation of the link from the email, vs. how you get there from the app itself. I don't yet know exactly which parts are causing the biggest issues, but here's the details.
Link from email:
https://dev.new.expensify.com:8082/r/3058871422043474/attachment?source=https%3A%2F%2Fwww.expensify.com.dev%2Fchat-attachments%2F5094796852905002131%2Fw_53497515bb3b313ac8e88c4efded655601d91524.png
URL from navigating in App:
https://dev.new.expensify.com:8082/attachment?source=https%3A%2F%2Fexpensify-dgalerosen.ngrok.io%2Fchat-attachments%2F5094796852905002131%2Fw_53497515bb3b313ac8e88c4efded655601d91524.png&type=r&reportID=3058871422043474&isAuthTokenRequired=true&fileName=Screenshot_2024-12-10_at_12.27.42.png
Differences:
https://dev.new.expensify.com:8082
**[EMAIL LINK HAS /r/<reportID>]**
/attachment?source=
[EMAIL HAS OLD DOT LINK, URL HAS NEW]
chat-attachments%2F5094796852905002131%2Fw_53497515bb3b313ac8e88c4efded655601d91524.png
[URL HAS &type=r&reportID=3058871422043474&isAuthTokenRequired=true&fileName=Screenshot_2024-12-10_at_12.27.42.png]
Playing around, I think a few things are happening:
- The report needs to be passed as a URL param, NOT as part of the url
- Possibly, the source needs to be a newdot link, though I'm not sure about that
fileNameandisAuthTokenRequiredseem to possibly not be required, though that seems odd on the latter front.- I'm not sure about
type
The nice thing is that it's consistent, it's not about whether or not the user has access to the particular report or attachment or whatever. That is, after I successfully open it, the email link still doesn't work. So it should be easy to reproduce / update that link once I find the logic.
hey @Gonals it looks like you wrote the initial URL that we use for attachment email links (here). any ideas on why these aren't working anymore?
That was a while ago, but it seems we have changed the URLs in Newdot?
Yeah hrm. Okay so I've got nearly all of what we need. I've updated the backend to use the right format:
URL_TO_NEW_DOT.'attachment?source='.$url.'&type=r&reportID='.$reportID;
This works on dev! Yay! However, I looked into production a little bit and I'm not 100% sure it will solve the problem. I found a recent image from the social channel. The link I received in my email (which doesn't work) was
https://new.expensify.com/r/6549335221793525/attachment?source=https://www.expensify.com/chat-attachments/1994588430180453104/w_ab9f5e72faca59f0bc1888e27f087a52d683bf6b.jpg
Adapting that into what my updated backend will send, we'll get:
https://new.expensify.com/attachment?source=https://www.expensify.com/chat-attachments/1994588430180453104/w_ab9f5e72faca59f0bc1888e27f087a52d683bf6b.jpg&type=r&reportID=6549335221793525
Unfortunately, that still doesn't work. Let's keep going.
The link that actually works, via App, is
https://new.expensify.com/attachment?source=https%3A%2F%2Fwww.expensify.com%2Fchat-attachments%2F7162688893835784434%2Fw_c622099d5dc912677747f0b1d9b2b0d91da26598.jpg&type=r&reportID=6549335221793525&isAuthTokenRequired=true&fileName=7594B93F-3659-4022-95AF-05728EADA518.jpg
Adapting that into the same format from my change, it still works like this:
https://new.expensify.com/attachment?source=https://www.expensify.com/chat-attachments/7162688893835784434/w_c622099d5dc912677747f0b1d9b2b0d91da26598.jpg&type=r&reportID=6549335221793525
At this point, we're at exactly the same link [format] as my new format. But it looks like the email link still wouldn't work, even with the changes - because the reportActionID (I assume that's what the numbers after chat-attachments are?) and the file name (w_....) are different.
I'm hoping that's unrelated, and it might work if we push this change? I'm heartened by it working on dev... but that's definitely peculiar.
BE fix that should hopefully fix this is merged, not yet deployed
Okay it did not fix it, I'm waiting to get a new image link so I can try to identify what else we can try.
@dangrous want me to send you an image? Don't open the DM so it will ship to your email.
that would be great @davidcardoza ! I just tried sending myself one from my expensifail account but it didn't come through, even after way more than 10 minutes... maybe yours will work
Sent a pic over via DM, it's a beaut.
So in that testing ^ it DID work as expected. Do you think we should have QA re-test this one more time?
I'll also send you one @davidcardoza for another local test.
Okay so it seems to work MORE of the time now, but not all the time.
- David -> Daniel worked!
- Daniel -> David worked!
- Another David -> Daniel didn't work on first click, but did on second.
- Another photo I happened to see come through worked!
I... am not sure what to do with that info haha. We're batting .750-1.000 but not certain it's enough. What do we think?
@JmillsExpensify @mjasikowski @dangrous this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@JmillsExpensify, @mjasikowski, @dangrous Whoops! This issue is 2 days overdue. Let's get this updated quick!
@JmillsExpensify, @mjasikowski, @dangrous Huh... This is 4 days overdue. Who can take care of this?
@JmillsExpensify, @mjasikowski, @dangrous 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
@JmillsExpensify, @mjasikowski, @dangrous 10 days overdue. Is anyone even seeing these? Hello?
@dangrous any updates here? Melvin is getting anxious
@JmillsExpensify, @mjasikowski, @dangrous Whoops! This issue is 2 days overdue. Let's get this updated quick!
oops hi, was on break for the holidays. In further testing, this still doesn't work reliably. I've got some more images that were sent in social, so I'm going to try to investigate them further and see what I can do
Okay so I noticed a couple things:
- All image links in emails direct to new.expensify.com. However, in the URL query the
sourceparam of the image is eitherwww.expensify.comorstaging.expensify.com. My guess is this is due to which platform the user uploaded the image on. However, if these don't match, the link doesn't work. prod and prod works, stag and stag works, but not a mix. So we should probably force the source link to be prod. - Weirdly, when you click on a link like
https://new.expensify.com/attachment?source=https://www.expensify.com/chat-attachments/4324233214072273054/w_786e7a0caedb4e522f56c6b328a1f1b8f88be853.jpg&type=r&reportID=6549335221793525, when the URL resolves in the browser the source ishttps:/www.expensify...- it loses one of the slashes. I haven't figured out why this is yet. It happens on both staging and prod urls. - The
sourceof in-app links are always URL encoded, but that seems separated from whether or not the links work. decoded good links are still good, encoded bad links are still bad. - The links clicked in app always have
&isAuthTokenRequired=true&fileName=[whatever].pngat the end but I'm pretty sure that it's not really necessary? it's hard to tell since there's so much else going on. - Lastly, it's so weird that it sometimes works now. It seems to be more often NOT in #social, but that doesn't really help. Still, sometimes is better than none of the time?
Sooo.. not really closer but at least we have some threads to pull on? I should probably try to figure out on the other side what happens - like when the app gets a deep link to an image, how does it parse it and what is it looking for. Rather than just looking to make them match exactly.
Side note: do we care that email links are always prod? What if you're logged in on staging and not prod? I guess it's mostly an internal question.
So good news - I've figured out how to get the file token and the authtoken required in the attachment link; bad news is it doesn't help. Asking for some help in Slack to point me towards where we handle these deeplinks in App so I can see if there's anything I can do on that side.