Skip to content

Jess/608 chk url#609

Merged
gjwgit merged 5 commits intodevfrom
jess/608_chk_url
Mar 13, 2026
Merged

Jess/608 chk url#609
gjwgit merged 5 commits intodevfrom
jess/608_chk_url

Conversation

@jesscmoore
Copy link
Collaborator

Pull Request Details

What issue does this PR address

  • issue SOLIDPOD: add url check before normalizefilepath #608 - this adds a url check, such that url is only prepended to a resource name, if the resource is not a url.
  • This change is required for work in notepod with issue Use a common share function notepod#362 which is reducing duplication in calls to GrantPermissionUi() for sharing notes, such that the one function call can be used for a user owned or externally owned note. In this case we are using the note url for both note types to specify the resource name.

Associated Issue

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Successfully shared both a own note and externally owned note in notepod branch jess/362_common_fns which uses note url for both.

Checklist

Complete the check-list below to ensure your branch is ready for PR.

  • Screenshots included in linked issue #
  • Changes adhere to the style and coding guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules
  • The update contains no confidential information
  • The update has no duplicated content
  • No lint check errors are related to these changes (make prep or flutter analyze lib)
  • Integration test dart test output or screenshot included in issue #
  • I tested the PR on these devices:
    • Android
    • iOS
    • Linux
    • MacOS
    • Windows
    • Web
  • I have identified reviewers
  • The PR has been approved by reviewers

Finalising

Once PR discussion is complete and reviewers have approved:

  • Merge dev into the this branch
  • Resolve any conflicts
  • Add a one line summary into the CHANGELOG.md
  • Push to the git repository and review
  • Merge the PR into dev

@jesscmoore jesscmoore requested a review from gjwgit March 11, 2026 23:57
@jesscmoore
Copy link
Collaborator Author

Jess to check whether exception will be thrown if string parsed is not a Url

Copy link
Contributor

@gjwgit gjwgit left a comment

Choose a reason for hiding this comment

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

https://api.flutter.dev/flutter/dart-core/Uri/parse.html

Uri.parse('::Not valid URI::'); // Throws FormatException.

Is a file path a valid URI? I think file:///path/to/file is okay but /path/to/file would raise an exception?

You might need a try/catch to capture the case when it is a filename and not a URI?

@jesscmoore
Copy link
Collaborator Author

Thanks for catching this.
Uri.parse and Uri.tryparse passed for both urls and filenames so did not form a useful check. Switched to use hasScheme check which returns false if no url scheme (and does not trigger an exception). Ready for review and merge.

@gjwgit gjwgit merged commit 0930e61 into dev Mar 13, 2026
20 checks passed
@gjwgit gjwgit deleted the jess/608_chk_url branch March 13, 2026 05:07
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.

2 participants