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

Desktop: Resolves #8625: Show missing sync password warning and link to FAQ #8644

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

This pull request

  1. displays a warning when the current sync target has an empty password
  2. shows a warning in sync settings when the sync password is empty
  3. in the warning (2) links to a new FAQ entry that explains a possible reason for missing sync target passwords.

1 and 2 are done on all systems. 3 is only done on MacOS.

Screenshots

Screenshot 2023-08-08 at 1 58 45 PM

Screenshot 2023-08-08 at 1 57 37 PM

Testing

  1. Set up sync with one of the following sync targets: 'webdav', 'nextcloud', 'amazon_s3', 'joplinServer', 'joplinCloud'
  2. Quit Joplin
  3. Open the system keychain manager and delete the sync target password (sync.9.password for Joplin Server): screenshot: macos keychain manager deleting sync.9.password
  4. Open Joplin
  5. Click "set the password" on the dialog that should display
  6. Click the FAQ link by the missing password warning.

Note: This has only been tested on an x86_64 Mac with the Joplin Sever sync target.

Notes

Currently, this applies to the following sync targets

	'webdav', 'nextcloud', 'amazon_s3', 'joplinServer', 'joplinCloud',

However, it is possible that there are valid reasons for some of these sync targets to have an empty password (e.g. a localhost WebDAV server). Perhaps some of these sync targets should be removed from the list.

Additionally, the missing password FAQ link is shown on any Mac.

onClick={openMissingPasswordFAQ}
style={theme.linkStyle}
>
{_('Why is my password missing?')}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Possible alternative:

Suggested change
{_('Why is my password missing?')}
{_('Help')}

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, just Help would be good. That's a temporary message that we'll keep just for the ARM64 transition, so we don't want to create too many new translatable strings for it


// The FAQ section related to missing passwords is specific to MacOS/ARM -- only show it
// in that case.
const showMacInfoLink = shim.isMac();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It may make sense to update this condition such that the warning is only shown on ARM 64 Macs. I only have access to an x86_64 Mac, however, so would be unable to test an ARM64-specific condition manually.

Copy link
Owner

Choose a reason for hiding this comment

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

Yes please enable it only for ARM64. I think you just need to check process.arch === 'arm64'

Comment on lines 5 to 7
const targetsExpectingPassword = [
'webdav', 'nextcloud', 'amazon_s3', 'joplinServer', 'joplinCloud',
].map(name => SyncTargetRegistry.nameToId(name));
Copy link
Owner

Choose a reason for hiding this comment

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

Usually sync target properties go in the SyncTargetXxx.ts class so that it's easy to find them back all in the same place. In that case you'd create a new property in BaseSyncTarget, probably true by default since most sync targets require a password, and you'd override for those that don't.

onClick={openMissingPasswordFAQ}
style={theme.linkStyle}
>
{_('Why is my password missing?')}
Copy link
Owner

Choose a reason for hiding this comment

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

Yes, just Help would be good. That's a temporary message that we'll keep just for the ARM64 transition, so we don't want to create too many new translatable strings for it


// The FAQ section related to missing passwords is specific to MacOS/ARM -- only show it
// in that case.
const showMacInfoLink = shim.isMac();
Copy link
Owner

Choose a reason for hiding this comment

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

Yes please enable it only for ARM64. I think you just need to check process.arch === 'arm64'


settingComps.push(
<p key='missing-password-warning' style={warningStyle}>
{_('Warning: Missing password.')} {showMacInfoLink ? macInfoLink : null}
Copy link
Owner

Choose a reason for hiding this comment

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

Also please make sure there's a space between "missing password." and the macInfoLink

@laurent22 laurent22 changed the base branch from dev to release-2.12 August 10, 2023 17:58
@personalizedrefrigerator
Copy link
Collaborator Author

I've applied the changes suggested above.

Currently, the missing password banner, synchronization password is missing, is shown on all devices when the password is empty. Should this be changed to only be shown on MacOS/ARM?

@laurent22
Copy link
Owner

Currently, the missing password banner, synchronization password is missing, is shown on all devices when the password is empty. Should this be changed to only be shown on MacOS/ARM?

No I think that was a good change, we should keep it for all platforms. The FAQ link was very specific to ARM64 so it's the only place we need a special case

@laurent22 laurent22 merged commit c6c2733 into laurent22:release-2.12 Aug 14, 2023
8 checks passed
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.

None yet

2 participants