This week felt like a steady mix of learning, fixing, and just trying to understand things properly. I’m still getting used to how everything connects in the system, but each small improvement made the bigger picture a little clearer.

Making Sorting Actually Work

I spent the first part of the week implementing server-side sorting for React Admin lists using a non-partitioned CouchDB setup. I’m still new to CouchDB’s indexing rules, so I had to go through a lot of trial and error.

Using PouchDB.createIndex() to build the Mango indexes dynamically was interesting — especially figuring out why the sort field must come last. I also learned how partial_filter_selector helps narrow down the index so we don’t generate unnecessary views.

Once the index was created, I used query() for sorting, filtering, and pagination. It wasn’t as straightforward as I expected, but it feels good to finally have it working in a clean and consistent way.

A Big Week for Test Coverage

The rest of the week was all about continuing on adding and improving tests. I’m still building confidence with testing, so this part taught me a lot.

What I Managed to Complete

  • Fixed a component bug
    The DownloadButton was crashing when the record wasn’t loaded yet. I almost went in circles trying to fix the tests before realising it was an actual null-check issue. Once that was patched, several failing tests passed immediately.
  • Added 14 new tests
    I wrote tests for Roles, Events, Results, Performances, and a few buttons. I also covered logic like:
    • reprocess buttons
    • spell-checking
    • dashboard calculations
    • function fields
    • login flow

Reflections & Insights

  • I’m learning that small bugs can cause big testing headaches.
  • Good test coverage makes the code feel a lot more dependable.
  • Sometimes it’s better to remove unnecessary work than to keep adding more.
  • I still make mistakes, but fixing them helps me understand the system more deeply.

What’s Next

Next week, I plan to enable meaningful sorting across Marks, Results, Performances, Events, and Roles. I’ll also revisit the tests if the new logic needs extra coverage. Slow progress, but I’m happy that things are becoming a bit clearer each week.


0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.