When a full bootstrap is initiated, LSE uses GraphQLClient.restModelsJsonStreamGen to request data from the server.
Request Format:
The request is a GET request to the /sync/bootstrap endpoint with two query parameters:
type: Set to "full".onlyModels: A comma-separated list of model names (derived from modelsToLoad).
Response Format:
The response is a stream of JSON objects. Each line (except the last) represents a single model instance. The final line contains a special metadata object prefixed with _metadata_=.
Metadata Fields:
method: The source of the data (e.g., "mongo").lastSyncId: The snapshot ID the client is now synchronized to.subscribedSyncGroups: The sync groups the client should subscribe to for incremental changes.databaseVersion: The version of the database schema.returnedModelsCount: A map of model names to the count of instances returned, used to verify request validity.
// Example of a model instance in the stream
{
"id": "556c8983-ca05-41a8-baa6-60b6e5d771c8",
"createdAt": "2024-01-22T01:02:41.099Z",
"updatedAt": "2024-05-16T08:23:31.724Z",
"number": 1,
"title": "Welcome to Linear 👋",
"priority": 1,
"boardOrder": 0,
"sortOrder": -84.71,
"startedAt": "2024-05-16T08:16:57.239Z",
"labelIds": ["30889eaf-fac5-4d4d-8085-a4c3bd80e588"],
"teamId": "89388c30-9823-4b14-8140-4e0650fbb9eb",
"projectId": "3e7ada3c-f833-4b9c-b325-6db37285fa11",
"projectMilestoneId": "397b95c4-3ee2-47b0-bad1-d6b1c7003616",
"subscriberIds": ["4e8622c7-0a24-412d-bf38-156e073ab384"],
"previousIdentifiers": [],
"assigneeId": "4e8622c7-0a24-412d-bf38-156e073ab384",
"stateId": "030a7891-2ba5-4f5b-9597-b750950cd866",
"reactionData": [],
"__class": "Issue"
}
// Example of the metadata line
_metadata_={"method":"mongo","lastSyncId":2326713666,"subscribedSyncGroups":["89388c30-9823-4b14-8140-4e0650fbb9eb"],"databaseVersion":948,"returnedModelsCount":{"Issue":3}}