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

Preview attachments for consumer/enterprise #2137

Closed
DenBond7 opened this issue Jan 5, 2023 · 18 comments · Fixed by #2314
Closed

Preview attachments for consumer/enterprise #2137

DenBond7 opened this issue Jan 5, 2023 · 18 comments · Fixed by #2314
Assignees
Milestone

Comments

@DenBond7
Copy link
Collaborator

DenBond7 commented Jan 5, 2023

    > Preview attachments https://github.com/FlowCrypt/flowcrypt-android/issues/1682

I think there should probably be no difference between consumer and enterprise here.

If RESTRICT_ANDROID_ATTACHMENT_HANDLING is present, apply restrictions, else don't apply restrictions, regardless of build.

We can file a separate issue for this to discuss the behavior in more detail.

Originally posted by @tomholub in #2123 (comment)

@DenBond7 DenBond7 self-assigned this Jan 5, 2023
@DenBond7
Copy link
Collaborator Author

DenBond7 commented Jan 5, 2023

https://flowcrypt.com/docs/technical/enterprise/configuration/client-configuration.html
image

It should be discussed. Based on #1682 (comment), we should use Content app to preview an attachment. As for me, it can be used only for a specific customer or just for an enterprise.

RESTRICT_ANDROID_ATTACHMENT_HANDLING was created after a request from one of our customers.

@tomholub
Copy link
Collaborator

tomholub commented Jan 5, 2023

The description of the client configuration doesn't say anything about this only being applicable to enterprise build. Therefore we should honor it on consumer build equally, but only when this client configuration is present (same on enterprise).

@DenBond7
Copy link
Collaborator Author

DenBond7 commented May 4, 2023

@sosnovsky (copy @tomholub) For now RESTRICT_ANDROID_ATTACHMENT_HANDLING works the same for all. If we would like to allow attachment previewing for the consumer version need to clarify the logic.

For example, if RESTRICT_ANDROID_ATTACHMENT_HANDLING is not present, we will have download and preview options for the consumer version. download will work as before(a user can download a file to the Downloads folder. Click on the attachment -> open it by available applications in a system). preview will download a file and open it by available applications in a system.

if RESTRICT_ANDROID_ATTACHMENT_HANDLING is present we will use the logic from https://flowcrypt.com/docs/technical/enterprise/configuration/client-configuration.html (The download button will save the file to the device, but not allow the user to directly tap to open it. Instead, the user has to navigate to the file through a file manager to open it. The view button allows the user to view the attachment without saving it, using the Content app on Android, if the user has it installed.). Please correct me if I'm wrong.

@sosnovsky
Copy link
Collaborator

For example, if RESTRICT_ANDROID_ATTACHMENT_HANDLING is not present, we will have download and preview options for the consumer version

As I understood, there should be only download button in this case, while preview button should be added only when RESTRICT_ANDROID_ATTACHMENT_HANDLING flag is present. So logic should be like this:

if RESTRICT_ANDROID_ATTACHMENT_HANDLING
    preview button - download to app folder and open in Content app
    download button - download to Downloads, on tap should open file in Content app
else
    download button - download to Downloads, on tap open in available apps
end

@DenBond7
Copy link
Collaborator Author

DenBond7 commented May 4, 2023

Based on #1828 non-enterprise users could have enabled preview functionality for all cases. I mean we can allow consumer users to have preview functionality for all cases. But if RESTRICT_ANDROID_ATTACHMENT_HANDLING is present there will be some restrictions(https://flowcrypt.com/docs/technical/enterprise/configuration/client-configuration.html)

@sosnovsky
Copy link
Collaborator

sosnovsky commented May 4, 2023

Ah, I see, then logic with look like this, right?

if RESTRICT_ANDROID_ATTACHMENT_HANDLING
    preview button - download to app folder and open in Content app
    download button - download to Downloads, on tap should open file in Content app
else
    preview button - download to app folder and open in available apps
    download button - download to Downloads, on tap open in available apps
end

@DenBond7
Copy link
Collaborator Author

DenBond7 commented May 4, 2023

Yup, you are right. What do you think about this logic? Can we use it?

@sosnovsky
Copy link
Collaborator

Yes, looks good, let's use it

@tomholub
Copy link
Collaborator

tomholub commented May 4, 2023

in case the client configuration docs are less clear then this, please take this chance to update them.

@sosnovsky
Copy link
Collaborator

in case the client configuration docs are less clear then this, please take this chance to update them.

yes, docs should be updated as currently they say Without this flag, attachments on an Android app only have a download button, but there will be 2 buttons for both cases - with and without RESTRICT_ANDROID_ATTACHMENT_HANDLING flag

@DenBond7
Copy link
Collaborator Author

DenBond7 commented May 4, 2023

I think there should probably be no difference between consumer and enterprise here.

To be honest I don't understand why we have to apply any configuration to the consumer version.

Please look at this address flowcrypt.com/docs/technical/ENTERPRISE/configuration/client-configuration.html. The address name says that it relates to the enterprise version.

@tomholub
Copy link
Collaborator

tomholub commented May 4, 2023

"enterprise" vs "consumer" app build

"enterprise" vs "consumer" configuration / environment

Client configurations are for enterprises, but they apply equally to enterprise app builds and consumer app builds, because enterprise app builds are difficult to deploy, and not every enterprise wants to run FES (FES being required is the biggest difference between enterprise build and consumer build).

consumer app in consumer environment - allowed
consumer app in enterprise environment - allowed
enterprise app in consumer environment - not allowed
enterprise app in enterprise environment - allowed

The URL says enterprise because client configuration is meant for enterprise customers. But it applies to enterprise and consumer apps equally, because some enterprises use consumer apps.

@DenBond7
Copy link
Collaborator Author

DenBond7 commented May 4, 2023

Now I see. In that case, it makes sense. No questions ))

@DenBond7
Copy link
Collaborator Author

DenBond7 commented May 4, 2023

@tomholub Can we add a tiny change to the documentation? The main changes:

  1. if the flag is missing we allow to download/preview an attachment and open it in the appropriate app, depending on the type of file and which apps the user has installed. It's a default behavior in Android.
  2. if the flag is present for download option I can change: but not allow the user to directly tap to open it. to the user may tap on the file to view or open it in the Content app on Android, if the user has it installed

image

OLD

Without this flag, attachments on an Android app only have a download button, and after downloading, the user may tap on the file to view or open it in the appropriate app, depending on the type of file and which apps the user has installed. With this flag, there will be two buttons instead: a download and a view button. The download button will save the file to the device, but not allow the user to directly tap to open it. Instead, the user has to navigate to the file through a file manager to open it. The view button allows the user to view the attachment without saving it, using the Content app on Android, if the user has it installed.

NEW

An Android app has two buttons: a download and a view button

The flag is missing. The download button will save the file to the device. After downloading, the user may tap on the file to view or open it in the appropriate app, depending on the type of file and which apps the user has installed. The view button allows the user to view the attachment without saving it, using the same logic we use for downloading.

The flag is present. The download button will save the file to the device, but not allow the user to directly tap to open it. Instead, the user has to navigate to the file through a file manager to open it. The view button allows the user to view the attachment without saving it, using the Content app on Android, if the user has it installed.

@tomholub
Copy link
Collaborator

tomholub commented May 4, 2023

Sure, but the text has to be improved a bit maybe, you can check with Roma on things like this.

@sosnovsky
Copy link
Collaborator

What about a bit shorter documentation text:

(affects only Android app) setting this flag will allow previewing and opening downloaded attachments only in Content app. Without this flag attachments can be opened with any supported app.

@DenBond7
Copy link
Collaborator Author

DenBond7 commented May 5, 2023

@sosnovsky looks good to me. Please open a separate issue to update docs in the right repo.

@sosnovsky
Copy link
Collaborator

@sosnovsky looks good to me. Please open a separate issue to update docs in the right repo.

Done - https://github.com/FlowCrypt/flowcrypt-web/issues/1064

DenBond7 added a commit that referenced this issue May 8, 2023
ioanmo226 pushed a commit that referenced this issue May 8, 2023
* Added using Content app if 'RESTRICT_ANDROID_ATTACHMENT_HANDLING' is present. Refactored code.| #2137

* Enabled previewing attachments for all users.| #2137

* Refactored code.| #2137

* Modified MessageDetailsEkmFlowTest.| #2137

* Modified MessageDetailsFlowTest.testStandardMsgPlaintextWithOneAttachment().| #2137

* Fixed a few bugs.| #2137
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 a pull request may close this issue.

3 participants