This repository was archived by the owner on Dec 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 445
Report the correct editing status to Unity. Fixes #934 #959
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There's two issues going on here - The `loggedInUser` field wasn't getting seeded with user information on load, so checking whether the current user owns a lock would always fail until the connections changed event got triggered somehow - `GetLock` didn't account for not having user information, so if the user was logged out, it would default to not allowing any edits. Since the info wasn't getting seeded, it would always report files as being locked by someone else. It now defaults to allowing edits if the user isn't signed in. Now, this isn't a bug, but if the user is not signed in, all bets are kinda off on validating locks. We should probably warn the user that we can't check whether they own the lock, but we should probably not lock down Unity entirely because of it.
18a3a75
to
be137f8
Compare
be137f8
to
84c543f
Compare
3c68631
to
84c543f
Compare
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.
Where or how is this preprocessor directive set?
src/UnityExtension/Assets/Editor/GitHub.Unity/ExtensionLoader/UnityAPIWrapper.cs
Show resolved
Hide resolved
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.
Can you tell me a bit more about this function call?
src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs
Show resolved
Hide resolved
StanleyGoldman
previously requested changes
Nov 27, 2018
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.
This seems like something we will forget one day...
src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs
Show resolved
Hide resolved
Okay, I understand all of this now. I'll do some tests against the newer version of Unity and I'll be ready to merge this. |
StanleyGoldman
approved these changes
Nov 28, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's two issues going on here:
The
loggedInUser
field wasn't getting seeded with user information on load, so checking whether the current user owns a lock would always fail until the connections changed event got triggered somehowGetLock
didn't account for not having user information, so if the user was logged out, it would default to not allowing any edits. Since the info wasn't getting seeded, it would always report files as being locked by someone else. It now defaults to allowing edits if the user isn't signed in. Now, this isn't a bug, but if the user is not signed in, all bets are kinda off on validating locks. We should probably warn the user that we can't check whether they own the lock, but we should probably not lock down Unity entirely because of it.