alan-turing-institute / whatwhat

A reimagining of nowwhat in OCaml
MIT License
0 stars 0 forks source link

Fix duplicate issues retrieved from GitHub #33

Closed mhauru closed 1 year ago

mhauru commented 1 year ago

Some Github issues appear in our list of issues twice. (For example, issue 418.)

@triangle-man: a possible reason is that the issue is on a "pagination" boundary, and is included in both pages.

mhauru commented 1 year ago

The issue is in our GraphQL query. Our query template has this:

[...]
            columns(first: 15) {
              edges {
                node {
                  name
                  cards(first: 20, after: CURSOR) {
                    edges {
                      cursor
                      node {
                        id
                        note
                        state
[...]

To make the actual query for page number i, we find the cursor of the last issue in our results for page i-1 (I think it's the last issue of the last column, but not certain), and fill that in to replace the placeholder CURSOR in the above template. But then all the columns use that cursor, and if the columns have varying numbers of cards in them, we might end up getting the last cards in some of the longest columns multiple times.

Haven't figured out how to best fix this yet.