Skip to content

ios: minimal set of changes for iOS app to work - #9619

Merged
calmh merged 190 commits into
syncthing:mainfrom
pixelspark:sushi
Jul 31, 2024
Merged

calmh merged 190 commits into
syncthing:mainfrom
pixelspark:sushi

Conversation

@pixelspark

Copy link
Copy Markdown
Contributor

Purpose

This PR contains the set of changes needed to make Syncthing work on iOS for my iOS app for Syncthing.

Most changes originate from the Mobius Sync fork. I have removed the changes from their fork that are not strictly needed for my app (i.e. their changes to the GUI and command line utilities, for instance) and squashed it all in a single commit.

In summary, the changes are:

  • Resolve non-absolute paths to the 'Documents' folder (basically the only one an app can/should write user data to by default on iOS)
  • Tweaking of build flags/conditions for iOS (i.e. determine which basicfs_watch, ignoreresult variant to build for iOS)
  • Disable upgrade mechanism on iOS
  • Make RequestGlobal and PullerProgress public symbols
  • Expose syncthing.app's Model instance (app.M)
  • Add no-op stub for SetLowPriority on iOS

I would very much appreciate these changes to be (eventually) merged to mainline syncthing, as this would allow my iOS app to track the mainline source code directly and removes the need (for me at least) for maintaining a separate fork. Perhaps the Mobius folks can also benefit from this (although as noted this branch does not contain their changes to e.g. the GUI).

Testing

This branch has been tested with the iOS app and appears to work fine. The full set of MobiusSync changes has been used before with success.

Screenshots

n/a

Documentation

There should be no visible changes for users due to this set of changes.

Authorship

The AUTHORS file contains changes to add my name and Simon Pickup (@sjpickup), who as authored the Mobius changes. Due to the squashing of the changes, his commits and hence his name have disappeared from commit metadata (I couldn't figure out a way to preserve the history correctly here in Git...)

@pixelspark
pixelspark requested a review from calmh as a code owner July 28, 2024 11:55
@pixelspark

pixelspark commented Jul 28, 2024 •

Copy link
Copy Markdown
Contributor Author

OK I now managed to actually add the history properly. This now shows a ton of commits (historical changes by Simon Pickup which do not all end up in this branch). The final set of changes ('files changed') however is quite small. Let me know if something else is preferred.

@calmh calmh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apart from the notes below, seems fine to me.

Comment thread lib/fs/basicfs.go Resolved
Comment thread lib/fs/basicfs_copy_range.go Resolved
Comment thread lib/syncthing/syncthing.go Resolved
@pixelspark

Copy link
Copy Markdown
Contributor Author

Some formatting to fix it seems in setpriority_noop, as well as a test:

Error: lib/model/mocks/model.go:3302:21: cannot use new(Model) (value of type *Model) as "github.com/syncthing/syncthing/lib/model".Model value in variable declaration: *Model does not implement "github.com/syncthing/syncthing/lib/model".Model (missing method RequestGlobal)

@imsodin

imsodin commented Jul 30, 2024

Copy link
Copy Markdown
Member

The tests fail due to auto-generted mocks that need regenerating due to the newly exported method: go run build.go testmocks.

@calmh
calmh merged commit de0b427 into syncthing:main Jul 31, 2024
pixelspark added a commit to pixelspark/sushitrain that referenced this pull request Jul 31, 2024
Comment thread lib/syncthing/syncthing.go Resolved
@acolomb acolomb mentioned this pull request Aug 5, 2024
imsodin pushed a commit that referenced this pull request Aug 11, 2024
### Purpose

Wrap access to Model for users that use the syncthing Go package. See
discussion:
#9619 (review)

### Testing

It works with the iOS app. Other than that, there are no current users
of this API (to my knowledge) as Model was only exposed recently form
the iOS app.
@calmh calmh added this to the v1.27.11 milestone Aug 13, 2024
calmh added a commit to calmh/syncthing that referenced this pull request Aug 19, 2024
* main: (46 commits)
  build: use Go 1.23, require minimum 1.22 (syncthing#9651)
  gui, man, authors: Update docs, translations, and contributors
  lib/fs: Put the caseFS as the outermost layer (syncthing#9648)
  gui: Add Irish (ga) translation template (syncthing#9646)
  gui, man, authors: Update docs, translations, and contributors
  lib/syncthing: Add wrapper for access to model (syncthing#9627)
  cli: Remove `go-shlex` dependency (syncthing#9644)
  lib/sha256: Remove it (syncthing#9643)
  build: Update dependencies (syncthing#9640)
  Chmod -x non-executable files (fixes syncthing#9629) (syncthing#9630)
  gui, man, authors: Update docs, translations, and contributors
  all: minimal set of changes for iOS app (syncthing#9619)
  gui, man, authors: Update docs, translations, and contributors
  gui, man, authors: Update docs, translations, and contributors
  etc: Remove restart on suspend systemd service (ref syncthing#8448) (syncthing#9611)
  gui, man, authors: Update docs, translations, and contributors
  lib/fs: Add missing locks to fakeFile methods (fixes syncthing#9499) (syncthing#9603)
  lib/api: Increase test request timeout (fixes syncthing#9455) (syncthing#9602)
  gui, man, authors: Update docs, translations, and contributors
  lib/ignore: Remove unused patterns in cache (syncthing#9601)
  ...
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jul 31, 2025
@syncthing syncthing locked and limited conversation to collaborators Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants