Skip to content

listremotes should send an empty array - #8498

Merged
ncw merged 1 commit into
rclone:masterfrom
Its-Just-Nans:listremotes-empty-nil
Jul 25, 2025
Merged

ncw merged 1 commit into
rclone:masterfrom
Its-Just-Nans:listremotes-empty-nil

Conversation

@Its-Just-Nans

Copy link
Copy Markdown
Contributor

What is the purpose of this change?

The remote call config/listremotes sends nil

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@albertony albertony left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. Makes sense to me.
Not sure if breaking anyone's existing workflow is a concern or not, what do you think?

@Its-Just-Nans

Its-Just-Nans commented Apr 22, 2025 •

Copy link
Copy Markdown
Contributor Author

Thanks. Makes sense to me. Not sure if breaking anyone's existing workflow is a concern or not, what do you think?

On my side, I think this change can break existing workflow "only" if the client does direct array access like list[0]
But since the endpoint sent null before, a direct array access is dangerous in any case and could break with ou without this change.

Demo : https://go.dev/play/p/0-LaG0CILKe

@Its-Just-Nans

Copy link
Copy Markdown
Contributor Author

Hi @ncw

What about this MR now?

Fixing a little ambiguous endpoint by always sending an array (even if empty)

@ncw ncw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great - thank you :-)

@ncw
ncw merged commit db4812f into rclone:master Jul 25, 2025
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