[HOLD for payment 2021-09-28] Avatar Image picker should be restricted to image extensions only.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Able to pick other file types for profile avatar and workspace avatar image.
Action Performed:
- Go to Settings
- Click Profile
- Click the pen icon to update or add a profile photo
- Click upload photo
- In Desktop or web -> file picker opens and allowed to select all file types
- In Mobile we show different options, Camera, Gallery, Document picker -> allows picking to other file types
Expected Result:
Should allow only to pick the image file formats or atleast show error after picking it's not a valid file format
Actual Result:
We allow picking other file types also, do not show any error messages also after picking
https://user-images.githubusercontent.com/85645967/129383495-bd1f53d2-f479-472d-bf5e-b9d940232ebe.mp4
https://user-images.githubusercontent.com/85645967/129383304-12185ae5-529a-4e52-950f-4a90aa9343cb.mov
Workaround:
Users can able to select images.
Platform:
Where is this issue occurring?
- Web
- iOS
- Android
- Desktop App
- Mobile Web
Suggestion
We should restrict file types while picking in desktop, we should not show document picker options in mobile.
Proposal
After discussion will provide a technical solution. Thanks
Version Number: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL:
Triggered auto assignment to @lschurr (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
Triggered auto assignment to @yuwenmemon (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Proposal
To achieve this we could do the following.
- In component
AttachmentPickerwe could introduce a new proptype. Like shown below
For web/desktop
- In AttachmentPicker
index.jswe can add a new method,
And use it in lines below, pass it as prop like accept={getAcceptableFileTypes(this.props.type)}
https://github.com/Expensify/App/blob/bdcafa3444f3839d7f5de2300e258caf681a50e3/src/components/AttachmentPicker/index.js#L15-L30
For Native
- In AttachmentPicker
index.native.js, Move the following lines, https://github.com/Expensify/App/blob/bdcafa3444f3839d7f5de2300e258caf681a50e3/src/components/AttachmentPicker/index.native.js#L82-L86
as shown below. For image picker, IMO I feel this unnecessary option so adding only when AttachmentPicker type is not image

Note: We want to use the above option also, then we can achieve just by modifying documentPickerOptions
we can add a new method,

And use it in here,

- We have a separate component
AvatarWithImagePickerin there we should pass the typeimageas shown below.
Let me know your thoughts on this thanks! @yuwenmemon
This looks like an issue worth solving, adding the External label for Triage.
@yuwenmemon there is no assignees here
Triggered auto assignment to @jboniface (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
uw posting is here: view this job
Triggered auto assignment to @tgolen (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@tgolen it looks like we have a proposal for review here
The proposal looks good to me. Let's move forward 🟢
@Santhosh-Sellavel please submit a proposal to the job so I can hire you when you get a chance
@jboniface submitted on proposal on upwork
@tgolen Few questions just to clarify the expected outcome.
Choose document options can I remove it for image picker flow alone as I proposed in the solution?

For the image picker case, yes, I agree with removing that.
On Fri, Sep 3, 2021 at 1:32 PM Santhoshkumar Sellavel < @.***> wrote:
@tgolen https://github.com/tgolen Few questions just to clarify the expected outcome.
Choose document options can I remove it? [image: image] https://user-images.githubusercontent.com/85645967/132056604-f12cf3e3-2ca5-4e75-818b-269aed0320ee.png
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Expensify/App/issues/4645#issuecomment-912764529, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJMAB3BPXCQH6JHTFQDO3TUAEPFBANCNFSM5CD2HYQQ .
Looks like the 7 day hold just started
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.1.0-2 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pulls/5320\n
If no regressions arise, payment will be issued on 2021-09-28. :confetti_ball: