At present ts_salobj retrieves at most max_history sample of historical data for a topic, where max_samples is almost always 1 (if history is wanted) or 0 (if not). This works fine in most cases, but is surprising and not very useful in one special case: reading an indexed SAL component with a Remote that has index=0 (meaning "read all indices"). Even in that special case only max_history samples are retrieved, and they might be for any index.
Improve retrieval of historical data in this special case by retrieving the most recent value for each index that is still in the DDS queue, in the order the data was received. Only allow max_history = 0 or 1 in this case, because trying to retrieve more per index would be very difficult (especially if reporting it in chronological order).
Note that for a SAL component with many indices (such as Script) or that is very chatty, it is quite likely that some historical data will no longer be available, having been pushed off the end of the DDS queue.
Also note that for Script this may return a lot of data, including for scripts that have finished. Fortunately ScriptQueue does not request historical data for Script topics.