Complex — yes, agree. From what’s known about the process at some of the border controls where the topic (search through people’s devices) is an issue then officials may use specialized software to grab all available data from the device.
This means contacts, messages, histories, including deleted content. For that reason, and after consulting with other experts, we recommend against traveling with your main device if protecting the anonymity of sources is vital.