esfalsa / crisscross

A web-based cross-endorsement tool.
https://esfalsa.github.io/crisscross/
GNU Affero General Public License v3.0
0 stars 0 forks source link

Exclude already-endorsed nations #6

Open esfalsa opened 1 year ago

esfalsa commented 1 year ago

Describe the problem

The list of nations to endorse currently includes all nations endorsing the provided point nation, including ones the user's nation has already endorsed.

Ideal solution

It should be possible to pull in recent endorsements given by the user nation from the world happenings API (which has filtering options, unlike the happenings hard of the nation API). Nations already endorsed by the user nation since it joined the World Assembly, and not subsequently un-endorsed, could be excluded.

Alternative solutions

If loading times are a concern, it might be possible to only fetch recent happenings to find the most recently endorsed nation that's still endorsing the point nation, and assuming all nations prior to that have already been endorsed.

Additional information

The world happenings API has some limitations. It seems to be limited to 200 events per page (based on some quick guess-and-check work), so it may take a few requests for nations that have been in the World Assembly for a while, and won't include happenings more than a week old, if memory serves.

esfalsa commented 1 year ago

As an additional thought, one way of mitigating the 28-second delay on the world happenings API could be querying the user nation's happenings shard as well. It won't always include all of the nations endorsed in the last 28 though, so the resulting behavior could also just end up being less intuitive than a warning to wait 28 seconds or even an artificial 28-second load delay.

esfalsa commented 1 year ago

The world happenings API has some limitations. It seems to be limited to 200 events per page (based on some quick guess-and-check work)

The limit of 200 has been confirmed. That probably provides decent mileage for most users, especially since the limit is the same irrespective of filter settings.