tabularray, just like tabularx, performs "trial" passes with its tables to calculate the size of things before a final pass where the table is actually typeset. This means that the contents of the table get to be processed multiple times, with some known implications. For example, tabularray offers the counter library to restore the value of counters set inside a tabularray tables.
Here on the site, there are a number of techniques for identifying trial passes for tabularx, for example: https://tex.stackexchange.com/a/227155/105447, https://tex.stackexchange.com/a/352134/105447, and https://tex.stackexchange.com/a/640035/105447.
So, the question is, is there an "official" method of distinguishing a trial from a final pass in tabularray? Failing that, are there any known reliable techniques, similar or equivalent to the ones existing for tabularx?
A MWE for the problem:
\documentclass{article}
\usepackage{tabularray}
\NewDocumentCommand{\onlyfinal}{}{%
% if trial
% do nothing
% else (if final)
% do something, for example:
\typeout{Dinner.}
\typeout{Oh no!}
% And, of course, no one wants dinner four times in a row.
}
\begin{document}
\begin{tblr}{
colspec = {@{}X[c]X[l]X[c]X[r]X[c]@{}},
hlines, vlines,
}
1 & 2 & 3 & 4\onlyfinal & 5 \
\end{tblr}
\end{document}