Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API v1] Delete latest is not working #475

Open
corey-aloia opened this issue Feb 7, 2024 · 3 comments
Open

[API v1] Delete latest is not working #475

corey-aloia opened this issue Feb 7, 2024 · 3 comments

Comments

@corey-aloia
Copy link
Contributor

when making a curl to the endpoint:

curl 'http://localhost:9000/api/v1/mailbox/my-inbox/latest' -X DELETE

I get a 200 ok back. But the message is there. If I instead use the message id, then the message is indeed deleted

curl 'http://localhost:9000/api/v1/mailbox/my-inbox/3' -X DELETE

Maybe I get time to work on this this week 👍 , or maybe you know right away how to fix :)

@jhillyerd
Copy link
Collaborator

I expect that it's not implemented, but could be fairly easily. We might want to create a re-usable piece of code that translates mailbox name+latest into an actual message ID, as I'm pretty sure it's just hacked in right now.

@corey-aloia
Copy link
Contributor Author

Thinking about it more, and it probably isn't a super useful endpoint. If you call get, then you have the message id, and can just use that to delete. Maybe a quick solution for now is to just return a 404 when calling this endpoint instead of a 200, and then implement if needed. I had just thought that it was already implemented but not working :)

@jhillyerd
Copy link
Collaborator

There is also a risk that you call GET latest while a new message is being delivered, then you call DELETE latest and delete the wrong one, so I'd be OK w/ 404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants