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

Inventory page showing resources multiple times? #107

Closed
sbocconi opened this issue Aug 11, 2021 · 5 comments
Closed

Inventory page showing resources multiple times? #107

sbocconi opened this issue Aug 11, 2021 · 5 comments

Comments

@sbocconi
Copy link

Looking at this page https://weloop.reflowproject.eu/user/01F5ZVRW4TY3C6M49FYZVHSXZ0/inventory

I do not get why the resources is shown twice, the inventory is for me (Stefano Bocconi) I assume.

I should then only see the resource once with the quantity I have, and not see what ocataco has (which is also of quantity zero), or am I missing something?

@sbocconi
Copy link
Author

Now having transferred the resource once again from ocataco (that did not have it) to myself, the resource is shown three times, twice with me as the owner, and once with ocataco as the owner.

@sbocconi
Copy link
Author

The same happens with resources that are pieces, like https://weloop.reflowproject.eu/resource/01FDYCSJ9DC52JZ16MN2N0B0Q1

I do not understant why performing the following query for my user:

{
  economicResourcesFiltered(agent:"01F5ZVRW4TY3C6M49FYZVHSXZ0") {
    name
    note
    id
    image
    accountingQuantity {
      hasUnit {
        label
      }
      hasNumericalValue
    }
    currentLocation {
      name
      lat
      long
    }
    tags 
    
  }
}

I get different ids for the same resource? The resources should be just 2 (3 with the first fake one).

{
  "data": {
    "economicResourcesFiltered": [
      {
        "accountingQuantity": null,
        "currentLocation": null,
        "id": "01FCT43X6B90AX3P66JEZ9X70R",
        "image": null,
        "name": "My first inventory",
        "note": "Created automatically",
        "tags": []
      },
      {
        "accountingQuantity": {
          "hasNumericalValue": 1,
          "hasUnit": {
            "label": "kilo"
          }
        },
        "currentLocation": {
          "lat": 4.9041389,
          "long": 52.3675734,
          "name": "Amsterdam, Netherlands"
        },
        "id": "01FCTNQZQVSHN050609HXA5DJV",
        "image": null,
        "name": "Gibson Les Paul Studio",
        "note": "I think that I should be able to define a provider here, for example a Music Shop, even if the provider does not have an account on WeLoop.\nWhy am I (Stefano Bocconi) not the owner of the resource?\nPlus the Unit are not working, I only see liter and kilo.",
        "tags": []
      },
      {
        "accountingQuantity": {
          "hasNumericalValue": -1,
          "hasUnit": {
            "label": "kilo"
          }
        },
        "currentLocation": {
          "lat": 4.9041389,
          "long": 52.3675734,
          "name": "Amsterdam, Netherlands"
        },
        "id": "01FCT51592SSVQG8WC64GM5ZYC",
        "image": null,
        "name": "Gibson Les Paul Studio",
        "note": "I think that I should be able to define a provider here, for example a Music Shop, even if the provider does not have an account on WeLoop.\nWhy am I (Stefano Bocconi) not the owner of the resource?\nPlus the Unit are not working, I only see liter and kilo.\nWho is the real owner?",
        "tags": []
      },
      {
        "accountingQuantity": {
          "hasNumericalValue": 0,
          "hasUnit": {
            "label": "kilo"
          }
        },
        "currentLocation": {
          "lat": 4.9041389,
          "long": 52.3675734,
          "name": "Amsterdam, Netherlands"
        },
        "id": "01FCTTR56J12PJGTECQ9VH0PAC",
        "image": null,
        "name": "Gibson Les Paul Studio",
        "note": "I think that I should be able to define a provider here, for example a Music Shop, even if the provider does not have an account on WeLoop.\nWhy am I (Stefano Bocconi) not the owner of the resource?\nPlus the Unit are not working, I only see liter and kilo.\nWho is the real owner?",
        "tags": []
      },
      {
        "accountingQuantity": {
          "hasNumericalValue": 1,
          "hasUnit": {
            "label": "kilo"
          }
        },
        "currentLocation": {
          "lat": 4.9041389,
          "long": 52.3675734,
          "name": "Amsterdam, Netherlands"
        },
        "id": "01FCX14WC7K33GRZYVDJ3MVRKW",
        "image": null,
        "name": "Gibson Les Paul Studio",
        "note": "I think that I should be able to define a provider here, for example a Music Shop, even if the provider does not have an account on WeLoop.\nWhy am I (Stefano Bocconi) not the owner of the resource?\nPlus the Unit are not working, I only see liter and kilo.\nWho is the real owner?",
        "tags": []
      },
      {
        "accountingQuantity": {
          "hasNumericalValue": -1,
          "hasUnit": {
            "label": "pieces"
          }
        },
        "currentLocation": null,
        "id": "01FDYCSJ9DC52JZ16MN2N0B0Q1",
        "image": null,
        "name": "Gibson Les Paul Studio -1",
        "note": "Inserted with the correct unity",
        "tags": []
      },
      {
        "accountingQuantity": {
          "hasNumericalValue": 1,
          "hasUnit": {
            "label": "pieces"
          }
        },
        "currentLocation": null,
        "id": "01FDYD862AQ9V7B0YJA91V0T98",
        "image": null,
        "name": "Gibson Les Paul Studio -1",
        "note": "Inserted with the correct unity",
        "tags": []
      },
      {
        "accountingQuantity": {
          "hasNumericalValue": 1,
          "hasUnit": {
            "label": "pieces"
          }
        },
        "currentLocation": null,
        "id": "01FDYDE9QDWHWJV6BGENV8CJ1V",
        "image": null,
        "name": "Gibson Les Paul Studio -1",
        "note": "Inserted with the correct unity",
        "tags": []
      }
    ]
  }
}

What am I missing?

@pral2a
Copy link

pral2a commented Sep 7, 2021

We found out that issue can be fixed in front-end. We should have it ready in less than a week.

@pral2a
Copy link

pral2a commented Sep 7, 2021

Aside from the front-end issue we also opened an issue that might help improve the inventory. Currently, there is not a straight way to get only the devices owned at a given time by the user. Instead, we need to filter in the client those where the user is not primarlyAccountable. We opened that issue about it dyne/zenpub#60

@pral2a
Copy link

pral2a commented Oct 29, 2021

Fixed via #149 - When creating a new event on an existing resource now you can choose to create a new resource as a result or only to update the existing one

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

2 participants