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

Number of categories differs between the GUI and the API #2222

Open
j0hannesr0th opened this issue Mar 28, 2024 · 8 comments
Open

Number of categories differs between the GUI and the API #2222

j0hannesr0th opened this issue Mar 28, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@j0hannesr0th
Copy link
Contributor

j0hannesr0th commented Mar 28, 2024

Description

The total count of categories presented in the GUI significantly varies when compared to what is available through the API.

Reproduction
Steps to reproduce the behavior:

  1. Add many recipes
  2. Compare the numbers

Expected behavior
The numbers should be the same.

Actual behavior
The numbers are different. The numbers shown in the GUI are correct. The API numbers are wrong.

Screenshots

API
[
    {
        "name": "Asia",
        "recipe_count": 18
    },
    {
        "name": "Beilagen",
        "recipe_count": 12
    },
    {
        "name": "Braten",
        "recipe_count": 2
    },
    {
        "name": "Brotzeit",
        "recipe_count": 6
    },
    {
        "name": "Cocktails",
        "recipe_count": 2
    },
    {
        "name": "Dessert",
        "recipe_count": 42
    },
    {
        "name": "Dünsten",
        "recipe_count": 2
    },
    {
        "name": "Eis",
        "recipe_count": 8
    },
    {
        "name": "Fisch",
        "recipe_count": 26
    },
    {
        "name": "Fleisch",
        "recipe_count": 28
    },
    {
        "name": "Gebäck",
        "recipe_count": 12
    },
    {
        "name": "Gemüse",
        "recipe_count": 2
    },
    {
        "name": "Getränke",
        "recipe_count": 6
    },
    {
        "name": "Grillen",
        "recipe_count": 24
    },
    {
        "name": "Hauptgericht",
        "recipe_count": 40
    },
    {
        "name": "Kuchen",
        "recipe_count": 55
    },
    {
        "name": "Muffins",
        "recipe_count": 14
    },
    {
        "name": "Salate",
        "recipe_count": 20
    },
    {
        "name": "Schnelle Küche",
        "recipe_count": 2
    },
    {
        "name": "Soße",
        "recipe_count": 2
    },
    {
        "name": "Suppe",
        "recipe_count": 8
    },
    {
        "name": "Torten",
        "recipe_count": 38
    },
    {
        "name": "Veggie",
        "recipe_count": 14
    },
    {
        "name": "Vorspeise",
        "recipe_count": 12
    },
    {
        "name": "*",
        "recipe_count": 1
    }
]
GUI

image

Browser
Chrome 123.0

Versions
Nextcloud server version: 28.0.3
Cookbook version: 0.11.0
Database system: MariaDB

@j0hannesr0th j0hannesr0th added the bug Something isn't working label Mar 28, 2024
@ewok2
Copy link

ewok2 commented Sep 9, 2024

Hello I also have this bug.
Number differrent between the app cookbook and the nextcloud GUI.
It seem's the error is in NC ans not the API / app IOS.
Capture d’écran 2024-09-09 à 21 32 25
The picture show a number to19 in todo and we can count only 16 receip

Browser
Firefox

Versions
Nextcloud server version: 29.0.6
Cookbook version: 0.11.1

@christianlupus
Copy link
Collaborator

OK, this sounds strange lik the DB had some broken entries. I have multiple ideas how to proceed here:

  1. Can anyone share their set of recipes (just zip the recipes folder in files app) here where the problem exists? I would like to import and see if I can reproduce.
  2. Do you have (direct) DB access? Then, we could have a look at the tables which indicate the categories. I can give/build the SQL commands to get more information if anyone is capable to execute these directly.

@ewok2
Copy link

ewok2 commented Sep 16, 2024

This evening I can zip the directory reciepe and send it to you (but it is 160 Mb befor zip)
And it is also possible for me to be in command line on the server with the possibility to log in maria DB, but my knowledge in SQL are very tiny ;-)

@ewok2
Copy link

ewok2 commented Sep 16, 2024

Hello
The zip zile is 160Mb...
And download is possible there :
https://nextcloud.schugart.net/s/M986rRaiJsYL2re

@christianlupus
Copy link
Collaborator

I tried downloading the zip file but it seems broken... I have a MD5 of 7acecec7ec0458d205d402012e9983cc. Is this true? Can you please check if the file can be unzipped by you?

@ewok2
Copy link

ewok2 commented Sep 17, 2024

Sorry the file was indeed broken (it had only 50Mb and not the 160,5Mb)
Know it should works
I have tested the download and unzip and it is Ok

@christianlupus
Copy link
Collaborator

Hmm, with the latest NC 31 (dev) version and the master branch, I cannot reproduce the problem. I put all 164 recipes (thanks for sharing 😉) into the instance and it detected all. The categories are assigned correctly.

I am still thinking on what the problem might be. I am considering some weird effect that the import just got broken in some way and the updating algorithm is written such that existing recipes are not readded once in the database cache. There are ways to solve this but I want to avoid big changed that are to be thrown away soon...

@ewok2
Copy link

ewok2 commented Sep 21, 2024

NC30 is already available (for stable branch)? Did not sdee it...
-> I will update

I was wondering if this behaviour is not because I use a "non standard way" to clone some reciepe...
For example I add a cake with raspberry, and I want to change raspberry with peach. so I copy / paste in the file file browser. Change the name of the directory and edit the "new" receip with NC Cookbook app.
This behavior had maybe put a strange thing in the database if it see once the same ID in the Json?

In any case this behaviour is not a problem for me :-)
As soon as you get many reciepe you stop counting them ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants