reapit / foundations

Foundations platform mono repo
57 stars 21 forks source link

403 when attempting to retrieve image provided in webhook payload #10700

Closed declanlawlor closed 6 months ago

declanlawlor commented 7 months ago

Describe the bug

At 17:04 we received a propertyimages.created webhook event with event id 4562eb-1195-4b13-9cf6-ae9d1c291883. When we attempted to retrieve the image provided in the payload, https://assets.reapit.net/sfg/live/pictures/DNL/23/DNL230123_17.jpg, we get a 403.

Expected behaviour When the webhook event is delivered to us, we expect the image to be available. In this case, it is many minutes later, and it is still not available.

Screenshots


>  date
Thu  8 Feb 2024 17:06:25 GMT
> curl https://assets.reapit.net/sfg/live/pictures/DNL/23/DNL230123_17.jpg
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>C8Z8NAH9MTCDXPSZ</RequestId><HostId>zyKsjvgJ34IDunvG9FD7qw6AdZhpc9OSzjUnFMS8R3ZqoKil7LGSyPjb5cq6z3OyYZ1yOp5ZwmScAoNf0TIMXQ==</HostId></Error>% 

Additional context We have seen this on a number of occasions.

Here is another example from 13:10 today - 09b0671d-7b2e-4750-ae13-edab38b1e78f

github-actions[bot] commented 7 months ago

Thank you for taking the time to report a bug. We prioritise bugs depending on the severity and implications, so please ensure that you have provided as much information as possible. If you haven’t already, it really helps us to investigate the bug you have reported if you provide ‘Steps to Replicate’ and any associated screenshots. Please ensure any personal information from the production database is obscured when submitting screenshots. This issue will be reviewed in our weekly refinement sessions and assigned to a specific project board. We may also update the ticket to request additional information, if required. For more information on our processes, please click here

HollyJoyPhillips commented 7 months ago

Internal: App is installed at org level

AshDeeming commented 7 months ago

Hi @declanlawlor The above referenced image has been removed by a user The property currently has 12 images, floorplan, EPC & QR Code

declanlawlor commented 6 months ago

@AshDeeming yes i wouldn't be surprised if the images have changed now, but when the event was received, the image was not available.

plittlewood-rpt commented 6 months ago

Hi @declanlawlor I've had a look at the customer's system and can see that the image you are reporting was added at 17:04:49 and then deleted at 17:04:57. Every event that hits the database is sent out, and in this case its very likely that the created event took longer than 8 seconds to get to you, by which time the media had been deleted.

I've just checked the initial example you provided and can see from the webhook transaction logs that the created event was sent at 17:04:59 and the modified event signalling the deletion was sent at 17:05:04 which confirms the above. Incidentally your server responded with a 500 status code so you got the same events multiple times if you did indeed process them. It's recommended to process events asynchronously and return immediately before kicking off any processing at your end.

plittlewood-rpt commented 6 months ago

The second example falls into the same category. The image was added to the system at 13:10:17 then deleted again at 13:12:39. This is a situation you will need to cater for as we can't prevent users adding images then deleting them straightaway. It looks with this one that the user added 3 floorplans then chose to get rid of 2 of them.

HollyJoyPhillips commented 6 months ago

Hi @declanlawlor closing as comment above has provided the information, please comment or reopen if you have any further issues. Thanks.

github-actions[bot] commented 6 months ago

It looks like you have commented on a closed issue. If your comment relates to a bug or feature request, please open a new issue, and include this issue number/url for reference. For more information on our processes, please click here