Project views are returned twice when creating a project #2242

Closed
opened 2024-03-29 18:14:05 +00:00 by waza-ari · 2 comments
Contributor

Description

When creating a new project, the API returns each created view twice, resulting in a bug in the frontend (PUT http://localhost:3456/api/v1/projects:

{
    "id": 39,
    "title": "Test1234",
    "description": "",
    "identifier": "",
    "hex_color": "",
    "parent_project_id": 0,
    "owner": {
        "id": 1,
        "name": "xxx",
        "username": "xxx",
        "created": "2023-11-16T20:10:40+01:00",
        "updated": "2024-03-23T13:01:55+01:00"
    },
    "is_archived": false,
    "background_information": null,
    "background_blur_hash": "",
    "is_favorite": false,
    "position": 2555904,
    "views": [
        {
            "id": 149,
            "title": "List",
            "project_id": 39,
            "view_kind": "list",
            "filter": "done = false",
            "position": 100,
            "bucket_configuration_mode": "none",
            "bucket_configuration": null,
            "default_bucket_id": 0,
            "done_bucket_id": 0,
            "updated": "2024-03-29T19:01:33.713765+01:00",
            "created": "2024-03-29T19:01:33.713769+01:00"
        },
        {
            "id": 150,
            "title": "Gantt",
            "project_id": 39,
            "view_kind": "gantt",
            "filter": "",
            "position": 200,
            "bucket_configuration_mode": "none",
            "bucket_configuration": null,
            "default_bucket_id": 0,
            "done_bucket_id": 0,
            "updated": "2024-03-29T19:01:33.722282+01:00",
            "created": "2024-03-29T19:01:33.722303+01:00"
        },
        {
            "id": 151,
            "title": "Table",
            "project_id": 39,
            "view_kind": "table",
            "filter": "",
            "position": 300,
            "bucket_configuration_mode": "none",
            "bucket_configuration": null,
            "default_bucket_id": 0,
            "done_bucket_id": 0,
            "updated": "2024-03-29T19:01:33.729643+01:00",
            "created": "2024-03-29T19:01:33.729647+01:00"
        },
        {
            "id": 152,
            "title": "Kanban",
            "project_id": 39,
            "view_kind": "kanban",
            "filter": "",
            "position": 400,
            "bucket_configuration_mode": "manual",
            "bucket_configuration": null,
            "default_bucket_id": 0,
            "done_bucket_id": 0,
            "updated": "2024-03-29T19:01:33.734841+01:00",
            "created": "2024-03-29T19:01:33.734846+01:00"
        },
        {
            "id": 149,
            "title": "List",
            "project_id": 39,
            "view_kind": "list",
            "filter": "done = false",
            "position": 100,
            "bucket_configuration_mode": "none",
            "bucket_configuration": null,
            "default_bucket_id": 0,
            "done_bucket_id": 0,
            "updated": "2024-03-29T19:01:33+01:00",
            "created": "2024-03-29T19:01:33+01:00"
        },
        {
            "id": 150,
            "title": "Gantt",
            "project_id": 39,
            "view_kind": "gantt",
            "filter": "",
            "position": 200,
            "bucket_configuration_mode": "none",
            "bucket_configuration": null,
            "default_bucket_id": 0,
            "done_bucket_id": 0,
            "updated": "2024-03-29T19:01:33+01:00",
            "created": "2024-03-29T19:01:33+01:00"
        },
        {
            "id": 151,
            "title": "Table",
            "project_id": 39,
            "view_kind": "table",
            "filter": "",
            "position": 300,
            "bucket_configuration_mode": "none",
            "bucket_configuration": null,
            "default_bucket_id": 0,
            "done_bucket_id": 0,
            "updated": "2024-03-29T19:01:33+01:00",
            "created": "2024-03-29T19:01:33+01:00"
        },
        {
            "id": 152,
            "title": "Kanban",
            "project_id": 39,
            "view_kind": "kanban",
            "filter": "",
            "position": 400,
            "bucket_configuration_mode": "manual",
            "bucket_configuration": null,
            "default_bucket_id": 0,
            "done_bucket_id": 0,
            "updated": "2024-03-29T19:01:33+01:00",
            "created": "2024-03-29T19:01:33+01:00"
        }
    ],
    "created": "2024-03-29T19:01:33.703583+01:00",
    "updated": "2024-03-29T19:01:33.710437+01:00"
}

Frontend:

image

After reloading, only the 4 default views are returned and everything looks good.

Vikunja Version

unstable

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Yes

Screenshots

No response

### Description When creating a new project, the API returns each created view twice, resulting in a bug in the frontend (PUT `http://localhost:3456/api/v1/projects`: ```json { "id": 39, "title": "Test1234", "description": "", "identifier": "", "hex_color": "", "parent_project_id": 0, "owner": { "id": 1, "name": "xxx", "username": "xxx", "created": "2023-11-16T20:10:40+01:00", "updated": "2024-03-23T13:01:55+01:00" }, "is_archived": false, "background_information": null, "background_blur_hash": "", "is_favorite": false, "position": 2555904, "views": [ { "id": 149, "title": "List", "project_id": 39, "view_kind": "list", "filter": "done = false", "position": 100, "bucket_configuration_mode": "none", "bucket_configuration": null, "default_bucket_id": 0, "done_bucket_id": 0, "updated": "2024-03-29T19:01:33.713765+01:00", "created": "2024-03-29T19:01:33.713769+01:00" }, { "id": 150, "title": "Gantt", "project_id": 39, "view_kind": "gantt", "filter": "", "position": 200, "bucket_configuration_mode": "none", "bucket_configuration": null, "default_bucket_id": 0, "done_bucket_id": 0, "updated": "2024-03-29T19:01:33.722282+01:00", "created": "2024-03-29T19:01:33.722303+01:00" }, { "id": 151, "title": "Table", "project_id": 39, "view_kind": "table", "filter": "", "position": 300, "bucket_configuration_mode": "none", "bucket_configuration": null, "default_bucket_id": 0, "done_bucket_id": 0, "updated": "2024-03-29T19:01:33.729643+01:00", "created": "2024-03-29T19:01:33.729647+01:00" }, { "id": 152, "title": "Kanban", "project_id": 39, "view_kind": "kanban", "filter": "", "position": 400, "bucket_configuration_mode": "manual", "bucket_configuration": null, "default_bucket_id": 0, "done_bucket_id": 0, "updated": "2024-03-29T19:01:33.734841+01:00", "created": "2024-03-29T19:01:33.734846+01:00" }, { "id": 149, "title": "List", "project_id": 39, "view_kind": "list", "filter": "done = false", "position": 100, "bucket_configuration_mode": "none", "bucket_configuration": null, "default_bucket_id": 0, "done_bucket_id": 0, "updated": "2024-03-29T19:01:33+01:00", "created": "2024-03-29T19:01:33+01:00" }, { "id": 150, "title": "Gantt", "project_id": 39, "view_kind": "gantt", "filter": "", "position": 200, "bucket_configuration_mode": "none", "bucket_configuration": null, "default_bucket_id": 0, "done_bucket_id": 0, "updated": "2024-03-29T19:01:33+01:00", "created": "2024-03-29T19:01:33+01:00" }, { "id": 151, "title": "Table", "project_id": 39, "view_kind": "table", "filter": "", "position": 300, "bucket_configuration_mode": "none", "bucket_configuration": null, "default_bucket_id": 0, "done_bucket_id": 0, "updated": "2024-03-29T19:01:33+01:00", "created": "2024-03-29T19:01:33+01:00" }, { "id": 152, "title": "Kanban", "project_id": 39, "view_kind": "kanban", "filter": "", "position": 400, "bucket_configuration_mode": "manual", "bucket_configuration": null, "default_bucket_id": 0, "done_bucket_id": 0, "updated": "2024-03-29T19:01:33+01:00", "created": "2024-03-29T19:01:33+01:00" } ], "created": "2024-03-29T19:01:33.703583+01:00", "updated": "2024-03-29T19:01:33.710437+01:00" } ``` Frontend: ![image](/attachments/3387921c-5e34-4ed0-bd0b-974e7597b7ae) After reloading, only the 4 default views are returned and everything looks good. ### Vikunja Version unstable ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? Yes ### Screenshots _No response_
waza-ari added the
kind/bug
label 2024-03-29 18:14:05 +00:00
Owner

Fixed in 81fe8391e4 - please check with the next unstable build.

Fixed in https://kolaente.dev/vikunja/vikunja/commit/81fe8391e49b46a248e031b64cfb38b60ff0a26b - please check with the next unstable build.
Author
Contributor

Confirmed working, thanks!

Confirmed working, thanks!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#2242
No description provided.