Board-buttons callback retain issue | Attempt to retain callback on plugin failed

Powerup board-buttons callback are not working after board switch.
Due to debug i’ve figured out there is some issue with powerup callback-cache and after you switch a board, PluginButton component will try to retain callback but new callback didn’t saved yet in a temporary object.

2 Likes

Hi, I have the same issue, did you find a solution for this ?

Hi, I have the same issue, did you find a solution?

A lot of problems with Trello capabilities in the last months.

I can offer 3 workarounds:

  • Just reload your iframe on board change, which could be pretty slow though.
let currentBoard = null;
window.TrelloPowerUp.initialize(
  {
    'board-buttons': (t) => {
        const context = t.getContext();
        if (currentBoard && currentBoard !== context.board) {
          window.location.reload();
        }
        currentBoard = context.board;
/*...*/
  },
);
  • Return null on board change on a first call and all next calls should be passed. It will make powerup buttons to blink for a second after, but at least buttons should work.
let currentBoard = null;
window.TrelloPowerUp.initialize(
  {
    'board-buttons': (t) => {
        const context = t.getContext();
        if (currentBoard && currentBoard !== context.board) {
          currentBoard = context.board;
          return null;
        }
        currentBoard = context.board;
/*...*/
  },
);
  • If you want a smooth solution without blinking and delay there is window.TrelloPowerUp.CallbackCache object which in theory allows you to reset registered callbacks and register it again.

The bug is pretty tricky and could be not easy to notice since if a board have multiple buttons from different powerups only first button’s powerup will catch the issue(but no sure about that for 100%), anyway no point to put much details here.

Let’s hope one day Trello team fix it.