oppia icon indicating copy to clipboard operation
oppia copied to clipboard

[BUG]: Pagination broken beyond page 2; pages 3–8 inaccessible, side arrow fails

Open reshmimahadevan opened this issue 3 months ago • 3 comments

Describe the bug

On the blogs records listing page no filters applied total record count 76:

Page 1: Displays correctly (records 1–10).

Page 2: First click shows “No more search results found / End of search results”. Refreshing the page resolves this and records 11–20 display.

Pages 3–8:

  • Using the Next/side arrow on Page 2 results in 500 Internal Server Error.

  • UI displays “Error: User not found”.

  • Records 21–76 cannot be accessed.

URL of the page where the issue is observed.

https://www.oppia.org/blog

Steps To Reproduce

  • Navigate to https://www.oppia.org/blog

  • Observe Page 1 → records 1–10 displayed.

  • Click Page 2 → first attempt shows error. Refresh → records 11–20 displayed (clicking on number 2 as well as side arrow works after refresh for Page 2 alone)

  • Attempt to access Page 3 → by Clicking the Next/side arrow → 500 error, UI shows “User data not found.”

Expected Behavior

  • Clicking any page or side arrow should return the correct set of records.

  • Pagination should work reliably without refreshes or errors.

Screenshots/Videos

https://github.com/user-attachments/assets/d992b980-dd48-4979-9452-d4a50cf63c51

What device are you using?

Desktop

Operating System

Windows

What browsers are you seeing the problem on?

Chrome

Browser version

No response

Additional context

No response

Tips for developers

Before addressing the bug, please identify which PR caused the issue (you can follow the steps here). If you identify the PR, comment on the issue with a link to it. If not, mention the commit hash of the oldest commit you saw the bug on (and the month and year it was made in).

Then, please leave a comment with details of the approach that you plan to take to fix the issue (see example).

Note: If this is your first Oppia issue, please make sure to follow our guidelines for choosing an issue and setting things up. You will also need to show a demo of the fix working correctly on your local machine. Thanks!

reshmimahadevan avatar Sep 10 '25 08:09 reshmimahadevan

Hi, I would like to work on it to start with contributing in oppia. Can u assign me this issue

lakshita10341 avatar Dec 10 '25 10:12 lakshita10341

Hi, I am a new contributor and need a help. Can u provide me a way so that I can replicate the same issue on my local.

lakshita10341 avatar Dec 10 '25 15:12 lakshita10341

@lakshita10341 , Can you please go through Oppia's wiki section, we have python setup which you can install on your machine and, follow the steps written for this issue.

wiki link : https://github.com/oppia/oppia/wiki

NITISH084 avatar Dec 10 '25 19:12 NITISH084

@NITISH084 , Thanks for helping. I was able to reproduced the error locally. I found that Firstly, when a user performs a search and then clears it, the searchPageIsActive flag in blog-home-page.component.ts stays true, causing “Next Page” to incorrectly call the search API instead of the normal homepage API. I will fix this by resetting the flag when the query and tags are cleared. Second, I identified a deeper pagination bug: when users jump directly to a later page (e.g., 1 → 7), the component appends results instead of placing them at the correct indices, leading to empty or misaligned data. I’ve updated the logic to support sparse arrays by padding skipped pages, inserting data at the correct index, and validating page data before rendering. These changes make pagination work reliably. Please assign this issue to me.

Image

lakshita10341 avatar Dec 11 '25 12:12 lakshita10341

Hi! I'm new to Oppia. I'd like to work on this issue. Could you please assign it to me?

Mangi09 avatar Dec 12 '25 15:12 Mangi09

Hi @seanlip & @mon4our ,

I would like to work on this issue

I can investigate the root cause and submit a fix. Please assign this issue to me if it is still open.

Thanks!

Abhinandankaushik avatar Dec 15 '25 16:12 Abhinandankaushik

I tested this on the latest version of Oppia and wasn’t able to reproduce the issue, so it appears to be fixed. Can someone help me to reproduce it ?

Shrujal00 avatar Dec 16 '25 06:12 Shrujal00

@Shrujal00 yeah it seems like it already fixed

Abhinandankaushik avatar Dec 16 '25 06:12 Abhinandankaushik

https://github.com/user-attachments/assets/357a7b87-06f7-42e6-8493-3cde27f36b89

No, the issue is still present. The problem occurs when tags are involved. If a tag is selected and then cleared, the application still internally points to the previously selected tag, which results in “No test results” being shown even though results should be available. U can produce the same issue if u will go to about section -> for parents/teachers -> check out our blog.

lakshita10341 avatar Dec 16 '25 08:12 lakshita10341

@lakshita10341 yes I checked the blog and it still present, i would like to work on this issue would you please assign it to me

Abhinandankaushik avatar Dec 16 '25 08:12 Abhinandankaushik

Hi, I was able to reproduce this issue on the blog page where pagination beyond page 2 triggers backend requests with invalid offsets, leading to a 500 error.

I traced this to the frontend pagination logic in blog-home-page.component.ts, where pagination requests are allowed even when the requested page exceeds the total number of published blog posts. I’m working on a fix that adds a guard to prevent invalid pagination requests from being sent to the backend.

Please let me know if this approach aligns with current expectations.

Image

Aditya22-smart avatar Dec 17 '25 18:12 Aditya22-smart