Back to Feed
article 3m read

Every time in my ticket panel's start-time column is the moment a session got linked

A change adds coding-session data to my issue tracker's tickets. The tenant check held, but the panel showed stand-in values with nothing marking them as stand-ins, mislabeled a link time as a start time, let one unsynced ticket blank the whole panel, and showed a green success banner for a button that sends nothing.

Article DepthPractice

Flow

My first three changes

Plans, not shipped work. Each one gets a test.

  1. 1Split the two loads

    Each section shows on its own, and an unsynced ticket gets a plain message.

  2. 2Rename the column

    The time is labeled as the link time it really is.

  3. 3Pull the button

    No green banner for an action that sends nothing.

Flow

Independent load states per section

Each section resolves on its own instead of sharing one error path.

  1. 1Sessions section

    Loading, ready, empty, not synced, or failed, shown alone.

  2. 2Metrics section

    Same states, unaffected by the sessions result.

  3. 3Not synced

    Plain copy that the ticket has not been imported yet, no retry.

  4. 4Failed

    Fixed message, details logged privately.

A column called Started At sits in the new ticket panel, and none of the times in it are when anything started.

I'm building a tool that records coding sessions. I want that data on the ticket, where people decide if the work is done, so this change adds a side panel to my issue tracker. The panel sends the ticket key to a small server function. That function calls my API with one stored key. The panel shows the sessions, two timing numbers, a status, and a button meant to hand the ticket to an agent.

The tenant check that holds

My API gets the organization from the key, never from the panel. So the panel can ask about any ticket in its own organization, but it can't reach into someone else's.

Past that check, things get loose.

A table built from one record

For now the API only knows that a session is linked to a ticket. The real numbers, like how long the session ran, aren't wired in yet. So the API sends zero for some of them and null for others. Nothing tells the panel which ones are real.

The Started At time is really the time the link was made. That could be much later than the real start.

The panel treats zero and empty alike.

Any zero or empty value prints N/A.

That works today only because every zero is fake. Once real numbers arrive, a true zero will look just like a missing one. If you build something like this, give each value a state, like measured, pending, or none, and draw each one differently.

One miss hides everything

The panel loads both sections together. If one fails, the whole panel shows an error. The failure I'd expect most is a ticket my system hasn't synced yet. So one expected miss hides the half that worked. The server function also passes my API's raw error text up to the screen. Load each section on its own, show a plain "not synced yet" message, and keep raw errors in your logs.

A button that sends nothing

The agent button shows a green success banner. The banner says in small print that it's a placeholder. Nothing is sent. If an action isn't built, hide it or disable it.

Encoding, permissions and a dev address

The ticket key isn't encoded. The list of allowed outbound hosts is too wide and includes a dev address. The app asks for tracker permissions it never uses. And there are no tests in the change.

Loads first, then the label, then the button

My order is: split the two loads, then rename the column, then pull the button. Each of those gets a test, which would be three more than the change has now.

Keep reading

Pick up a connected idea or branch into a nearby one.

5 paths forward