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
[Sandstorm] Firefly III creates more than one user instead of using the main user #1568
Comments
Alright, I'm going to poll @ocdtrekkie here because I am not sure if I am following Sandstorm behavior. In the old situation: multiple users could access a single administration (ie. a single grain). Firefly III would bundle everybody into a single Firefly III user (so Bob, Alice and others would all share user 1). In the new situation, Firefly III leans on Sandstorm to tell it who's accessing the grain. Users are found or created. Bob gets 1, Alice gets 2, etc. However since Firefly II does not allow multiple users to access the same data set, you've suddenly lost access. I don't particularly mind breaking this behavior (and thus restoring the old function) but I could use Jacob's insight here. I hope I can answer your question asap. |
The above-quoted function looks significantly different than your current code: https://github.com/firefly-iii/firefly-iii/blob/master/app/Http/Middleware/Sandstorm.php The original poster suggests that somehow an old version of Sandstorm.php ended up in your package. Is this possible? |
I would definitely say the expected behavior of sharing a Firefly III grain with someone is that that person would be able to see their Firefly III data. Presumably if someone wanted their own Firefly III data, they'd make their own Firefly III grain. |
No, the code is newer. It was greatly simplified to speed up Firefly III. I can fix the behaviour and push a new version. Would be end of this month, to coincide with other fixes. Would that work? |
Alright I've pushed a fix. The code can be replaced manually, if you want to. I'm going to test this but right now I'm getting 404's:
I had it before and it worked again after some time, so stay tuned! |
Thanks for the fix, it's fine if it's released at the end of the month. |
@JC5 The sandstorm/debian-jessie64 box no longer exists. I can send you a PR to update your .sandstorm directory a bit. |
That's cool, just push it to |
Found a flaw in one of your modifications in .sandstorm as well, so I'm fixing that too. Just trying to test my changes. |
See #1569 for less sadness building for Sandstorm |
👍 the build works, the fix works, and I'll submit some other updates as well. |
So how can we fix this situation after user 2 was already created? Revoking access on Sandstorm doesn't seem to help. We're on version 4.7.5.3. |
The system should fall back to the oldest user automatically. |
Correct me if I'm wrong, but this looks like it tries to find a user with the given email first and only if it doesn't, it'll use the oldest user. So once you run into the issue and a separate user is created, then that user is always used instead of the oldest user. |
You're right of course! I'll think of something to delete that user. |
Bug description
I am running Firefly III version 4.7.5.1 on Sandstorm
I've noticed since the lastest update that users with whom they've shared a Firefly III grain can't access the account's data, and are shown the interface as if nothing was present.
Steps to reproduce
Create a Firefly III grain on Sandstorm, share it to another user, the new user won't be able access the data created by the first and his profile will show an ID of 2 or more.
I managed to reproduce the bug on Sandstorm Oasis in demo mode
Extra Info
I've found the root cause as being an old version of
app/Http/Middleware/Sandstorm.php
being packaged inside the spk.Our installed version comes from here
https://apps.sandstorm.io/app/uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70
The spk package being https://app-index.sandstorm.io/packages/ed958b9fed3330f1e48a2b0603e82950
When I checked the contents of the file using
spk unpack
on the package that I've downloaded from there, I found out that it didn't handle multiple users gracefully.This is a snippet taken from the file extracted
I tried updating the file but it didn't work without overriding the checks on $count as the database now contains more than one user (making the latest code throw an exception saying
Your Firefly III installation has more than one user, which is weird.
)The text was updated successfully, but these errors were encountered: