Skip to content

[Collections] Should be able to delete a non-existent local collection #3401

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

Merged
merged 1 commit into from
Apr 14, 2021

Conversation

yim-lee
Copy link
Contributor

@yim-lee yim-lee commented Apr 13, 2021

Steps to reproduce:

  1. Add a local collection
  2. Delete or rename the local collection file
  3. Try deleting the local collection

Result: Error about local file not found
Expected: Non-existent local collection deleted

The remove collection subcommand calls getCollection API to fetch collection's name for displaying success message later. getCollection tries to fetch collection from storage, and if it's not found there, it fetches from the source directly. The error is caused by the source validation logic, which mistakenly is the first thing getCollection does but should really only be done when we need to fetch from the source.

Steps to reproduce:
1. Add a local collection
2. Delete or rename the local collection file
3. Try deleting the local collection

Result: Error about local file not found
Expected: Non-existent local collection deleted

The `remove` collection subcommand calls `getCollection` API to fetch collection's name for displaying success message later. `getCollection` tries to fetch collection from storage, and if it's not found there, it fetches from the source directly. The error is caused by the source validation logic, which mistakenly is the first thing `getCollection` does but should really only be done when we need to fetch from the source.
@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 13, 2021

@swift-ci please smoke test

@yim-lee yim-lee merged commit de60ad2 into swiftlang:main Apr 14, 2021
@yim-lee yim-lee deleted the delete-moved branch April 14, 2021 16:03
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.

2 participants