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

[BUG]: Errata list does not display correctly due to race condition #430

Closed
1 task done
pastalian opened this issue Feb 12, 2025 · 12 comments · Fixed by AlmaLinux/albs-frontend#588
Closed
1 task done
Assignees
Labels
bug Something isn't working needs triaging

Comments

@pastalian
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

  • Only the first errata entry is displayed, and "Loading..." never finishes.Image

  • Errata info is not displayed.
    Image

Expected Behavior

No response

Steps To Reproduce

No response

Anything else?

this.platforms is a computed value and may be empty when platformName() is executed, which can result in accessing a non-existent label property.

platforms: https://github.com/AlmaLinux/albs-frontend/blob/d394c514f297ffa59682f97418fc44b08f2beb51/src/pages/ErrataFeed.vue#L309

platformName: https://github.com/AlmaLinux/albs-frontend/blob/d394c514f297ffa59682f97418fc44b08f2beb51/src/pages/ErrataFeed.vue#L534

Search terms

errata

@pastalian pastalian added the bug Something isn't working label Feb 12, 2025
pastalian added a commit to pastalian/albs-frontend that referenced this issue Feb 12, 2025
`this.platforms` is a computed value and may be empty when
`platformName()` is executed, which can result in accessing a
non-existent `label` property.

This fix unsure that matched platform exists before accessing it,
preventing UI breakage.

Fixes: AlmaLinux/build-system#430
@javihernandez
Copy link
Member

javihernandez commented Feb 13, 2025

Hey @pastalian, thanks for the report!
I can't reproduce the issue here, and to me, it looks like a different problem. Let's check the following:

  • Are both frontend and backend up to date?
  • Can you show me the output of the /api/v1/platforms/ endpoint?
  • Can you get the output from the /api/v1/errata/all/ endpoint and show me a few records (different than the only one that appears in the list)?

@pastalian
Copy link
Author

pastalian commented Feb 14, 2025

Tested with:

  • web-server: ba5d39ab402ec757051a78e3e202931715c15413
  • frontend: d394c514f297ffa59682f97418fc44b08f2beb51
/api/v1/platforms/
[
  {
    "id": 1,
    "name": "AlmaLinux-8",
    "distr_type": "rhel",
    "distr_version": "8",
    "pgp_key": null,
    "arch_list": [
      "i686",
      "x86_64",
      "aarch64",
      "ppc64le",
      "s390x"
    ],
    "modularity": {
      "versions": [
        {
          "name": "8.4",
          "dist_prefix": "el8.4.0",
          "version_prefix": "80400"
        },
        {
          "name": "8.5",
          "dist_prefix": "el8.5.0",
          "version_prefix": "80500"
        },
        {
          "name": "8.6",
          "dist_prefix": "el8.6.0",
          "version_prefix": "80600"
        },
        {
          "name": "8.7",
          "dist_prefix": "el8.7.0",
          "version_prefix": "80700"
        },
        {
          "name": "8.8",
          "dist_prefix": "el8.8.0",
          "version_prefix": "80800"
        },
        {
          "name": "8.9",
          "dist_prefix": "el8.9.0",
          "version_prefix": "80900"
        },
        {
          "name": "8.10",
          "dist_prefix": "el8.10.0",
          "version_prefix": "81000"
        }
      ],
      "packages_git": "https://git.almalinux.org/rpms/",
      "git_tag_prefix": {
        "modified": "a8",
        "non_modified": "c8"
      },
      "modified_packages_url": "https://git.almalinux.org/almalinux/modified_packages/raw/branch/main/a8.yml"
    }
  },
  {
    "id": 2,
    "name": "AlmaLinux-9",
    "distr_type": "rhel",
    "distr_version": "9",
    "pgp_key": null,
    "arch_list": [
      "i686",
      "x86_64",
      "aarch64",
      "ppc64le",
      "s390x"
    ],
    "modularity": {
      "versions": [
        {
          "name": "9",
          "dist_prefix": "el9.0.0",
          "version_prefix": "90000"
        },
        {
          "name": "9.1",
          "dist_prefix": "el9.1.0",
          "version_prefix": "90100"
        },
        {
          "name": "9.2",
          "dist_prefix": "el9.2.0",
          "version_prefix": "90200"
        },
        {
          "name": "9.3",
          "dist_prefix": "el9.3.0",
          "version_prefix": "90300"
        },
        {
          "name": "9.4",
          "dist_prefix": "el9.4.0",
          "version_prefix": "90400"
        },
        {
          "name": "9.5",
          "dist_prefix": "el9.5.0",
          "version_prefix": "90500"
        }
      ],
      "packages_git": "https://git.almalinux.org/rpms/",
      "git_tag_prefix": {
        "modified": "a9",
        "non_modified": "c9"
      },
      "modified_packages_url": "https://git.almalinux.org/almalinux/modified_packages/raw/branch/main/a9.yml"
    }
  },
  {
    "id": 3,
    "name": "AlmaLinux-10",
    "distr_type": "rhel",
    "distr_version": "10",
    "pgp_key": null,
    "arch_list": [
      "x86_64",
      "x86_64_v2",
      "aarch64",
      "ppc64le",
      "s390x",
      "riscv64"
    ],
    "modularity": null
  },
  {
    "id": 4,
    "name": "AlmaLinux-Kitten-10",
    "distr_type": "rhel",
    "distr_version": "10",
    "pgp_key": null,
    "arch_list": [
      "x86_64",
      "x86_64_v2",
      "aarch64",
      "ppc64le",
      "s390x",
      "riscv64"
    ],
    "modularity": null
  }
]
/api/v1/errata/all/
[
  {
    "id": "ALSA-2025:A005",
    "updated_date": "2025-02-14T00:00:00",
    "platform_id": 1
  },
  {
    "id": "ALSA-2025:A004",
    "updated_date": "2025-02-14T00:00:00",
    "platform_id": 2
  },
  {
    "id": "ALSA-2025:A003",
    "updated_date": "2025-02-14T00:00:00",
    "platform_id": 2
  },
  {
    "id": "ALSA-2025:A002",
    "updated_date": "2025-02-12T00:00:00",
    "platform_id": 2
  },
  {
    "id": "ALSA-2025:A001",
    "updated_date": "2025-02-12T00:00:00",
    "platform_id": 2
  }
]
  • what I see most of the time with the above data
    Image

  • sometimes (once in about 30 refreshes) it is displayed correctly
    Image

Checking the console log confirms that this.platforms is indeed empty at first.

diff --git a/src/pages/ErrataFeed.vue b/src/pages/ErrataFeed.vue
index 84bd681..29c09bd 100644
--- a/src/pages/ErrataFeed.vue
+++ b/src/pages/ErrataFeed.vue
@@ -532,6 +532,7 @@
         return advisory.title ? advisory.title : advisory.original_title
       },
       platformName(id) {
+        console.log(this.platforms)
         return this.platforms.find((platform) => platform.value == id).label
       },
     },

Image

  • docker log during the /errata page load
albs_nginx_1                      | 192.168.122.1 - - [14/Feb/2025:09:37:22 +0000] "GET /ws HTTP/1.1" 101 3738 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0" "-"
albs_nginx_1                      | 192.168.122.1 - - [14/Feb/2025:09:37:22 +0000] "GET /errata HTTP/1.1" 304 0 "http://albs2:8080/" "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0" "-"
albs_nginx_1                      | 192.168.122.1 - - [14/Feb/2025:09:37:22 +0000] "GET /vendor.js HTTP/1.1" 304 0 "http://albs2:8080/errata" "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0" "-"
albs_nginx_1                      | 192.168.122.1 - - [14/Feb/2025:09:37:22 +0000] "GET /app.js HTTP/1.1" 304 0 "http://albs2:8080/errata" "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0" "-"
albs_nginx_1                      | 192.168.122.1 - - [14/Feb/2025:09:37:22 +0000] "GET /src_layouts_MainLayout_vue.js HTTP/1.1" 304 0 "http://albs2:8080/errata" "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0" "-"
albs_web_server_1                 | INFO:     172.18.0.25:59550 - "GET /api/v1/platforms/ HTTP/1.0" 200 OK
albs_nginx_1                      | 192.168.122.1 - - [14/Feb/2025:09:37:22 +0000] "GET /api/v1/platforms/ HTTP/1.1" 200 1952 "http://albs2:8080/errata" "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0" "-"
albs_web_server_1                 | INFO:     172.18.0.25:59536 - "GET /api/v1/users/all_users HTTP/1.0" 200 OK
albs_nginx_1                      | 192.168.122.1 - - [14/Feb/2025:09:37:22 +0000] "GET /api/v1/users/all_users HTTP/1.1" 200 205 "http://albs2:8080/errata" "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0" "-"
albs_nginx_1                      | 192.168.122.1 - - [14/Feb/2025:09:37:22 +0000] "GET /src_pages_ErrataFeed_vue.js HTTP/1.1" 304 0 "http://albs2:8080/errata" "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0" "-"
albs_web_server_1                 | INFO:     172.18.0.25:59558 - "GET /api/v1/errata/query/?title=&id=&cveId=&pageNumber=1 HTTP/1.0" 200 OK
albs_nginx_1                      | 192.168.122.1 - - [14/Feb/2025:09:37:22 +0000] "GET /api/v1/errata/query/?title=&id=&cveId=&pageNumber=1 HTTP/1.1" 200 12449 "http://albs2:8080/errata" "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0" "-"

@pastalian
Copy link
Author

Hmm, maybe this is specific to Firefox.

Image
(left: firefox, right: chromium)

@javihernandez
Copy link
Member

javihernandez commented Feb 14, 2025

Hm, interesting, I'm on Firefox 134, and working fine here. What's yours?
About the race condition, it's weird, because the platforms are dispatched at the router level, see:

{
    path: 'errata',
    component: () => import('pages/ErrataFeed.vue'),
    beforeEnter(to, from, next) {
        store
            .dispatch('platforms/loadPlatformList')
            .then(next())
            .catch(next())
    },
},

The platform list is dispatched (and stored) before loading the page, that's why I think that it's a different problem, or something weird happened in a recent Vue.js (or related) update.

@pastalian
Copy link
Author

I have Firefox 135 🤔

@javihernandez
Copy link
Member

Interesting, I can reproduce it now with both versions of Firefox (webkit-based ones work fine). However, I can only reproduce the problem sometimes when you navigate from / to /errata. Can you please test if the changes in AlmaLinux/albs-frontend#588 fixes your issue?

javihernandez added a commit to javihernandez/albs-frontend that referenced this issue Feb 14, 2025
@pastalian
Copy link
Author

It didn't work for me :(

@javihernandez
Copy link
Member

It didn't work for me :(

Can you double check that it is still happening when navigating from / (build feed) to errata? If you are navigating from other path, then, we should try fixing that one too.

Also, does it change when you are logged in vs logged out?

@pastalian
Copy link
Author

pastalian commented Feb 14, 2025

Yeah, I'm still having the issue with

  1. open a private window
  2. open /
  3. open /errata

Image

I'm not seeing any difference between logged in/out.

@pastalian
Copy link
Author

pastalian commented Feb 14, 2025

OK, so enabling "Disable Cache" from "F12 -> Network tab" seems to fix it. I think this means the errata page is still loading too fast normally. I don't really know what's going on right now ¯\_(ツ)_/¯

@javihernandez
Copy link
Member

OK, so enabling "Disable Cache" from "F12 -> Network tab" seems to fix it.

Can you please enable it back? Then, check if the problem goes away with and without my fix

@pastalian
Copy link
Author

  • Check "Disable Cache"
    • Works fine, regardless of whether your fix is applied or not
  • Uncheck "Disable Cache"
    • Fails most of the time, with or without your fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triaging
Projects
Status: Done
2 participants