-
Notifications
You must be signed in to change notification settings - Fork 182
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
Sync lock toggle #954
base: master
Are you sure you want to change the base?
Sync lock toggle #954
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "rojo" | ||
version = "7.4.0" | ||
version = "7.4.3" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Undo version change. |
||
rust-version = "1.70.0" | ||
authors = ["Lucien Greathouse <[email protected]>"] | ||
description = "Enables professional-grade development tools for Roblox developers" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.0 | ||
7.4.3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Undo version change. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -104,6 +104,14 @@ function SettingsPage:render() | |||||
layoutOrder = layoutIncrement(), | ||||||
}), | ||||||
|
||||||
SyncLock = e(Setting, { | ||||||
id = "syncLock", | ||||||
name = "Sync Lock", | ||||||
description = "Toggle sync lock", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This description is not clear at all, and doesn't explain any more than the title already says.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
||||||
transparency = self.props.transparency, | ||||||
layoutOrder = layoutIncrement(), | ||||||
}), | ||||||
|
||||||
SyncReminder = e(Setting, { | ||||||
id = "syncReminder", | ||||||
name = "Sync Reminder", | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -299,7 +299,7 @@ function App:getHostAndPort() | |
return if #host > 0 then host else Config.defaultHost, if #port > 0 then port else Config.defaultPort | ||
end | ||
|
||
function App:isSyncLockAvailable() | ||
function App:isSyncLockAvailable() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove whitespace. Make sure to always format your changes with StyLua. |
||
if #Players:GetPlayers() == 0 then | ||
-- Team Create is not active, so no one can be holding the lock | ||
return true | ||
|
@@ -408,21 +408,24 @@ function App:useRunningConnectionInfo() | |
end | ||
|
||
function App:startSession() | ||
local claimedLock, priorOwner = self:claimSyncLock() | ||
if not claimedLock then | ||
local msg = string.format("Could not sync because user '%s' is already syncing", tostring(priorOwner)) | ||
local syncLockEnabled = Settings:get("syncLock") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the wrong way to go about this. Consider the case of two users, Zack and Micah. Zack has locking enabled, Micah has it disabled. Zack is currently syncing and claimed the lock. With your implementation, Micah can steal the lock from Zack but Zack cannot steal it back. Zack's settings made it clear that he did not want anyone else to sync over him. Micah doesn't mind if people sync over him, yet Zack still cannot because his setting is checking the lock. The correct way to implement this setting would be that users with locking disabled simply do not claim the lock themselves, thus allowing other users to claim it. If everyone on your team disables it, then the lock is always unclaimed and anyone can sync whenever. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, what do we do in the case where someone without locking is syncing, and then someone with locking starts syncing? The new user doesn't want other people syncing. Should the unlocked user be forced to stop syncing? Your feature needs to consider all the cases, not just your use case of the entire team setting it the same way. |
||
|
||
Log.warn(msg) | ||
self:addNotification(msg, 10) | ||
self:setState({ | ||
appStatus = AppStatus.Error, | ||
errorMessage = msg, | ||
toolbarIcon = Assets.Images.PluginButtonWarning, | ||
}) | ||
if syncLockEnabled then | ||
local claimedLock, priorOwner = self:claimSyncLock() | ||
if not claimedLock then | ||
local msg = string.format("Could not sync because user '%s' is already syncing", tostring(priorOwner)) | ||
|
||
return | ||
end | ||
Log.warn(msg) | ||
self:addNotification(msg, 10) | ||
self:setState({ | ||
appStatus = AppStatus.Error, | ||
errorMessage = msg, | ||
toolbarIcon = Assets.Images.PluginButtonWarning, | ||
}) | ||
|
||
return | ||
end | ||
end | ||
local host, port = self:getHostAndPort() | ||
|
||
local baseUrl = if string.find(host, "^https?://") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should put this in the
## Unreleased Changes
section, you are not making a new release.