Skip to content

Artisan command for "refetching" user avatars for existing users - #3232

Closed
shelmz wants to merge 1 commit into
BookStackApp:developmentfrom
shelmz:development
Closed

Artisan command for "refetching" user avatars for existing users#3232
shelmz wants to merge 1 commit into
BookStackApp:developmentfrom
shelmz:development

Conversation

@shelmz

@shelmz shelmz commented Feb 3, 2022

Copy link
Copy Markdown

Added an artisan command to search for new (gr)avatar for given user but deletes previous avatar, even if no new one is found.
Solves #1893.

search for new (gr)avatar for given user but deletes previous avatar, even if no new one is found
@ssddanbrown

Copy link
Copy Markdown
Member

Hi @shelmz, Thanks for offering this. Looks functionally good.

A few notes from my side:

  • I think the command should be named using "Refetch" instead of "Reset" since people may instead expect it to be reset to the default empty state. Fetching enforces the idea we'd be "fetching" the image from elsewhere.
  • The $signature needs to be updated since it still refers to reset MFA.
  • The User is being injected in via the constructor but not used, can be removed (Including the comment on line 27).
  • Ideally we'd add a test to cover the functionality (example). Just say if not comfortable though and I can add this afterwards.
  • I think we should have an optional --users-without-avatars flag which will run this for all users without avatars assigned. This would considerably help the scenario given in Artisan command for "refetching" user avatars for existing users. #1893 where they presumably have many existing users without avatars, rather than them needing to run this command for each id/email desired.

@ssddanbrown

Copy link
Copy Markdown
Member

Since there's been no follow-up I'm going to close this but would be happy to re-open or accept a new PR if the above notes can be taken into account.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants