oddsdk / odd-app-template

A sveltekit web app template for the ODD SDK.
https://odd-template.fission.app
MIT License
29 stars 10 forks source link

Localhost domain user names are not unique. #103

Closed jeffgca closed 1 year ago

jeffgca commented 1 year ago

This probably requires some more investigation - it seems like when I run WAT on localhost and try to create a new user 'jeff' - if I have run any other WAT app on localhost and created a user named 'jeff' the system says the name is taken.

This is an interesting problem, once we have more developers all wanting their own first name as their user on multiple localhost'd apps, over time this will become an annoyance. Maybe there's something we can do to treat localhost as a special case?

bgins commented 1 year ago

Once we have merged the filesystem recovery work in https://github.com/webnative-examples/webnative-app-template/pull/101 and https://github.com/webnative-examples/webnative-app-template/pull/102 each user should have a unique name because their display name will be appended by their DID.

The other change needed for this to work will be assigning each WAT app a unique namespace.

https://github.com/webnative-examples/webnative-app-template/blob/ddd5f1d92eb9c806f37578d717f0830778c1f5b9/src/lib/app-info.ts#L6

Changing the creator or name will create a unique namespace for the app in browser storage. That should make it possible to register a new 'jeff` made unique by the DID in their underlying username.

It's worth exploring this outside of WAT because it depends on the filesystem recovery work. The work in https://github.com/fission-codes/webnative/pull/421 may provide a path forward for this because developers could use it to define a username scheme that makes each username unique in some way.

jeffgca commented 1 year ago

Oh yeah! That was smart of us.

bgins commented 1 year ago

Implemented in #101 and #102.