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

[HMA] Implement exchange delete API #1733

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aokolish
Copy link

Summary

This PR implements the exchange delete API which previously would just return a 501 when called.

Test Plan

Unit tests + I manually tested this in my local HMA dev env & UI.

@facebook-github-bot
Copy link
Contributor

Hi @aokolish!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

Copy link
Contributor

@Dcallies Dcallies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you run into problems internally signing the CLA, I can take over the PR and merge it if you cannot.

Comment on lines 445 to 446
if collab is None:
return {"message": "success"}
abort(501, "Not yet implemented")
abort(404, f"exchange '{exchange_name}' not found")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocking: I think we debated this when we originally implemented it, and thought it was less confusing to say that deleting something that doesn't exist is success, so you can naively retry errors.

All the other deletions (e.g. bank delete) follow this pattern as well, so I'm hesitant to add exceptions unless I can understand more about the case.

Did you run into a condition that led you to conclude to change it, or is this just a taste change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's ok with me.

I was following what I thought was the established pattern. I see it in bank_delete_content for example. However, the rest of the APIs that 404 on things not being found are for updates.

@aokolish aokolish requested a review from Dcallies January 27, 2025 19:48
@aokolish aokolish changed the title Implement exchange delete API [HMA] Implement exchange delete API Jan 29, 2025
@Dcallies
Copy link
Contributor

@aokolish - thanks a ton for contributing to HMA! Let me know if the CLA is a hard blocker - I can merge when it's complete, or else tell me to take over.

@Dcallies
Copy link
Contributor

@aokolish - looks like you just need to run the black formatter as well

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

Successfully merging this pull request may close these issues.

3 participants