A federal judge said he will order the Trump administration to preserve records of a text message chat in which senior national security officials discussed plans for a U.S. military strike.