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

Shared grains associate with apps by name, not ID #3598

Open
ocdtrekkie opened this issue Jan 7, 2022 · 11 comments
Open

Shared grains associate with apps by name, not ID #3598

ocdtrekkie opened this issue Jan 7, 2022 · 11 comments
Labels

Comments

@ocdtrekkie
Copy link
Collaborator

So this one really confused me: I installed @orblivion's experimental Etherpad package, which I knew had a different appId than the official one, and is not an upgrade. You can see this because I now have two Etherpad installs:
etherpadbug0

I was really vexed to already have a grain made with it, considering it's a new app I haven't played with before, from 2017 no less!
etherpadbug1

Interestingly enough, the same grain also appears in the official Etherpad app's grain list:
etherpadbug2

But the official one has grains I created in addition to ones shared with me. Which suggests to me that the grains shared with me are being matched to the app by name, not ID.

It doesn't offer to upgrade the grain or anything since it's not my grain, and it loads it in the correct version for whoever owns that grain, but it doesn't seem like it should appear here.

@ocdtrekkie
Copy link
Collaborator Author

It does occur to me that this may be because Sandstorm servers generally aim to obscure appIds and packageIds that other users have installed because they may not be publicly available. So that is something we probably need to bear in mind when addressing this: It's possible the solution would be worse than the problem from a security standpoint, and the likelihood normal users would have two apps with the exact same name is probably slim.

@orblivion
Copy link
Contributor

orblivion commented Jan 7, 2022 via email

@zenhack
Copy link
Collaborator

zenhack commented Jan 7, 2022

Another data point that may be related (that I've been meaning to report as a separate bug, but I'm always on my phone when I notice it): I have a separate account that I log into on my phone, since I don't trust my phone as far as my computer. On that account, I have sandcal & prioritize grains I shared from the main account before I'd actually made icons for those apps -- and on the phone account the icons for those grains show up as the auto-generated thing for apps with no icons still. So it definitely seems like we have some problems with getting app info for shared grains.

@orblivion
Copy link
Contributor

orblivion commented Jan 10, 2022

I had a hypothesis - these two Etherpad grains that show up as "shared" for me were created on Oasis and mass-transferred to my current server. Perhaps this puts it in a state that this list considers it "shared"? BTW one of them has a "was: " in this view. Per my hypothesis it would have been the name on the original server.

I just tried duplicating it by creating a new sandstorm server and mass-transferring an etherpad grain. However, the mass transfer feature doesn't seem to be working. Filed #3599

@orblivion
Copy link
Contributor

(I did an inspect-element to change the file names)
etherpad-1
etherpad-2

@kentonv
Copy link
Member

kentonv commented Jan 11, 2022

I think this is intentional. The idea is that we want to encourage people to hack on their apps and run modified versions. We don't want it to be the case that if one person happens to use a modified Etherpad, then no one else can find the documents that person shared because they don't show up under their own Etherpad install.

To that end, I think we group shared documents by app title.

@ocdtrekkie
Copy link
Collaborator Author

I can see that logic. Any idea what could cause Dan's example, where the grains show he owns them under one view, and that they're shared under another view?

@ocdtrekkie ocdtrekkie removed the bug label Jan 11, 2022
@ocdtrekkie
Copy link
Collaborator Author

I'm removing the bug label since Kenton thinks the functionality we opened the issue for is by design.

@kentonv
Copy link
Member

kentonv commented Jan 11, 2022

Any idea what could cause Dan's example, where the grains show he owns them under one view, and that they're shared under another view?

Ah, that part seems like a bug. Probably what's happening here is that sometimes a grain you own also appears in the list of grains shared with you, because somehow you shared it with yourself (or maybe owned grains are always shared with oneself, I'm not sure). But on the client side, when we construct the list of grains for an app, we merged the list of grains you own created with that app (filtered by app ID) with the list of grains shared with you that were created by any app with the same title. We then de-dupe, so a grain that is both owned by you and shared with you will only appear as owned by you. But if the grain is owned by you but created with a different app with the same title, then it only appears in the "shared with me" list and doesn't get de-duped with anything, I suppose.

@ocdtrekkie
Copy link
Collaborator Author

That is such a niche bug case I am having a hard time wrapping my head around how to rename this issue to reflect it.

@ocdtrekkie
Copy link
Collaborator Author

I think we should just leave this issue here as an informational testament to both the intended behavior and the weird edge case that is probably way too niche to spend time and effort fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants