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

[issue] Some asset can't show "share asset profile" on asset page #2979

Closed
sync-by-unito bot opened this issue Aug 8, 2023 · 19 comments
Closed

[issue] Some asset can't show "share asset profile" on asset page #2979

sync-by-unito bot opened this issue Aug 8, 2023 · 19 comments
Assignees

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented Aug 8, 2023

User story

As a user, I want to be able to share the profile of any asset on the asset page, regardless of its type or settings, ensuring consistent sharing functionality for all assets.

Reproduce step

  1. Go to capture app
  2. choose an asset & enter the detail page
  3. press share icon
  4. It just show "View asset profile", "Copy IPFS address", it doesn't show "share asset profile"

IMG_4853.PNGsample: bafybeicapntpoczejnn3447k2nouz4bul3f5atlfla6s5egulmvcwgtzvm

Expectation

When user press share button, it should show "View asset profile", "Copy IPFS address" and "Share Asset Profile"

IMG_4854.PNG

Additional information:

┆Issue is synchronized with this Asana task by Unito
┆Created By: Kenny Hung

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 8, 2023

➤ Kenny Hung commented:

Currently, this issue seems occur with newer asset.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 8, 2023

➤ Scott Yan commented:

need first to check What is the condition displayed " share asset profile " on app

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 14, 2023

➤ Kenny Hung commented:

It seems related about ✓ [FR] Drop CAI injection in backend ( https://app.asana.com/0/0/1204952756643597 ).

This part is deployed on 7/24.

When the asset is created after 7/24, that asset can't display "Share Asset Profile" option.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 23, 2023

➤ Sam commented:

Kenny Hung, can you provide example asset id? It can be [email protected] ( mailto:[email protected] ) account.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 23, 2023

➤ Kenny Hung commented:

Sam Yes,

asset nid: bafybeih3nwvwqbflhj6k7tm76gggjo2vdx3lfuzdooglfwvhkvw7p4lxga

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 23, 2023

➤ Sam commented:

Kenny Hung, currently capture cam will show "share asset profile" if cai_file is not null .

I checked and cai_file of bafybeih3nwvwqbflhj6k7tm76gggjo2vdx3lfuzdooglfwvhkvw7p4lxga is null that's why "share asset profile" is not shown.

  1. So if cai_file is null what QA expects to see?
  2. Should I show "Share Asset Profile" even if cai_file is null?

image.png

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 23, 2023

➤ Scott Yan commented:

Sam ( cc Kenny Hung ) the cai _ file field was removed to the backend two sprints ago and will not be generated it . Please correct and use other fields to judge

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 23, 2023

➤ Kenny Hung commented:

Sam Just confirm, does Scott's comment answer your question?

Or you need another help?

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 23, 2023

➤ Sam commented:

Scott Yan, thank you for clarification.

My proposal is to rely on asset.id.

In capture cam when user captures an image/video asset.id is null in the beginning. Later when asset is registered capture cam set asset.id to id returned by backend.

So I think relying on asset.id can be an option. Because

  • If asset.id is null it means asset is not registered yet.
  • if asset.id is not null it means asset is registered.

So I will show "Share Asset Profile" if asset.id is not null.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 23, 2023

➤ Sam commented:

Kenny Hung, yes Comment by @scott Yan on [issue] Some asset can't show "share asset profile" on asset page ( https://app.asana.com/0/0/1205170085148260/1205330224528317/f ) was helpful.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 23, 2023

➤ Sam commented:

Kenny Hung, one more question.

I check backend asset ( https://dia-backend-dev.numbersprotocol.io/api/v3/redoc/#operation/assets_read ) which has other interesting fields I could rely on.

  • asset.is_original_owner (can be true or false)
  • asset.owner is email (is email of owner)
  • asset.source_type (can be "original" | "post_capture" | "store" )

My question is "Share Asset Profile" can be executed

  1. if source_type is store
  2. if is_original_owner is false

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 23, 2023

➤ Kenny Hung commented:

Sam (cc Tammy YangScott Yan)

I suppose "Yes". Just user own this asset, they could share their asset's asset profile.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 23, 2023

➤ Sam commented:

Kenny Hung, thank you for response.

Scott Yan (cc: Tammy Yang) how about this?

  1. if is_original_owner is true
  2. if source_type is post_capture

If condition 1 and 2 are met then allow "Share Asset Profile"

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 24, 2023

➤ Kenny Hung commented:

Sam As my understand, both #1 & #2 include in user own this asset.

Therefore #1, #2 are Yes. (cc Tammy Yang)

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 24, 2023

➤ Sam commented:

Kenny Hung, what about when source_type is original or store ?

I just need confirm logic table so I can convert it to code.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 24, 2023

➤ Kenny Hung commented:

Sam About this part you don't need to judge is_original_owner , the rule should be when user own this asset, user should be able to share the asset profile. No matter asset is from original, post_capture & store.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 24, 2023

➤ Sam commented:

Kenny Hung thank you for confirmation. I will implement it now in code.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 24, 2023

➤ Sam commented:

James Chien, need your confirmation before it will happen during code review.

The goal is to show "Share asset profile" on asset details page. "Share asset profile" menu option should be shown if current user is the owner of asset.

My initial thought was if asset.owner == currentUser.email then show "Share asset profile". And I think it should work fine because so far capture cam only allow users to sign up by email.

However in the future if capture cam we implements feature Sign up with Web3 address ( https://dia-backend-dev.numbersprotocol.io/api/v3/redoc/#operation/auth_users_signup_web3 ) then asset.owner == currentUser.email will not work for users who signed up with Web3 address.

My questions are

  1. should I keep it simple and just rely on asset.owner == currentUser.email
  2. should I rely on "address" thing?

In 1st case it is simple and will work until capture cam implements Web3 sign up.

In 2nd case it will work when we implement Web3 Sign Up and we will not have to revisit this task again with extra checks like if user has email then check by email if not then check by address.

Also want to confirm that to determine asset ownership I can do currentUser.address == asset.owner_addresses.asset_wallet_address instead of currentUser.address == asset.owner_addresses.managed_wallet_address

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 24, 2023

➤ James Chien commented:

Sam Rely on address is better. Web3 sign up has been implemented in backend for quite some time and there are users without email.

owner_addresses.asset_wallet is the old name for the integrity wallet, which is also the user’s address, it’s right to check this field.

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

No branches or pull requests

1 participant