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

feat: Add setIsArchiveDevice() method #932

Merged
merged 9 commits into from
Oct 22, 2024
Merged

Conversation

gmaclennan
Copy link
Member

@gmaclennan gmaclennan commented Oct 22, 2024

Does not change sync at this time, but does persist setting.

Fixes #680

Does not change sync at this time, but does persist setting.
@gmaclennan gmaclennan self-assigned this Oct 22, 2024
@gmaclennan gmaclennan requested a review from EvanHahn October 22, 2024 11:44
@gmaclennan
Copy link
Member Author

gmaclennan commented Oct 22, 2024

Currently this throws if trying to call manager.setIsArchiveDevice() before first calling setDeviceInfo(). Not sure what the alternative is?

@awana-lockfile-bot
Copy link

package-lock.json changes

Click to toggle table visibility
Name Status Previous Current
@comapeo/core2.0.1 ADDED - 2.0.1

@gmaclennan
Copy link
Member Author

I decided to remove the requirement that setDeviceInfo() must be called before calling setIsArchiveDevice() by migrating the deviceInfo column to be nullable, which required manually writing the migration because SQLite does not support ALTER COLUMN statements. I added a test for the migration, which checks that any device info set before migration is still readable after migration.

@awana-lockfile-bot
Copy link

package-lock.json changes

Click to toggle table visibility
Name Status Previous Current
@comapeo/core2.0.1 ADDED - 2.0.1

Copy link
Contributor

@EvanHahn EvanHahn left a comment

Choose a reason for hiding this comment

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

LGTM other than a few nitpicks and small questions.

src/mapeo-manager.js Show resolved Hide resolved
src/mapeo-manager.js Outdated Show resolved Hide resolved
src/mapeo-manager.js Outdated Show resolved Hide resolved
src/mapeo-project.js Outdated Show resolved Hide resolved
test-e2e/manager-archive-device.js Outdated Show resolved Hide resolved
test-e2e/manager-archive-device.js Outdated Show resolved Hide resolved
test-e2e/manager-archive-device.js Outdated Show resolved Hide resolved
test-e2e/manager-archive-device.js Outdated Show resolved Hide resolved
src/mapeo-project.js Show resolved Hide resolved
src/mapeo-project.js Outdated Show resolved Hide resolved
@awana-lockfile-bot
Copy link

package-lock.json changes

Click to toggle table visibility
Name Status Previous Current
@comapeo/core2.0.1 ADDED - 2.0.1

@awana-lockfile-bot
Copy link

package-lock.json changes

Click to toggle table visibility
Name Status Previous Current
@comapeo/core2.0.1 ADDED - 2.0.1

@awana-lockfile-bot
Copy link

package-lock.json changes

Click to toggle table visibility
Name Status Previous Current
@comapeo/core2.0.1 ADDED - 2.0.1

@awana-lockfile-bot
Copy link

package-lock.json changes

Click to toggle table visibility
Name Status Previous Current
@comapeo/core2.0.1 ADDED - 2.0.1

@gmaclennan gmaclennan merged commit 5975e03 into main Oct 22, 2024
8 checks passed
@gmaclennan gmaclennan deleted the feat/archive-device-method branch October 22, 2024 19:50
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.

Add a device setting to configure what to sync
2 participants