In this lesson, you followed one hiker’s message through the assistant, found every copy it leaves, and gave each copy its lifetime.
Key Points
- Hikers type more than the answer needs. Marta’s message holds her name, a booking reference, her friend’s asthma and her phone number, but the answer needs only the place and the day.
- The request to your provider carries the question with all of Marta’s details. It lives as long as the call.
- The provider keeps a copy. Not training on API data is a separate promise from not keeping it. Providers keep requests for about 30 days by default, longer for flagged content or a legal hold. Some also keep a stored copy you can fetch by its ID, for at least 30 days unless you switch it off.
- Your trace holds two copies, in the
retrievespan’squeryand themodelspan’srequest. Your trace writer keeps them for 30 days. The daily sweep deletes each day’s file once that day is 30 days old. The sweep runs at startup and once a day, so only while your app runs. The request log holds no copy, because it writes only the fields you chose, like the safe log line in Configuration, CORS and Logging for Node APIs. - An eval case built from a hiker’s report is another copy, kept as long as your repository. Take the names, numbers and health details out by hand first, and drop any detail the failure doesn’t need. A cache in your app would be one more.
- The numbers: one question left four copies of Marta’s details on this map, counting the provider’s copy once, though a provider can hold more than one (its logs and, if switched on, a stored response). Your app keeps its own for 30 days. The provider keeps its copies by its own terms.
- Map every copy, give each its lifetime, and send and keep only what the answer needs.
Final Code
In model/index.js, name the fields a request may carry, so nothing else reaches the provider: