FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

fetch-tool fails to work with SharedTree ops

Open arafat-java opened this issue 1 year ago • 0 comments

Describe the bug

When fetch-tool is used to fetch all the ops it fails to fetch block of type="idAllocation" associated with SharedTree This op usually comes with sequenceNumber=2 with Brainstorm sample app

The op data looks as follows

{
  "minimumSequenceNumber": 1,
  "sequenceNumber": 2,
  "clientId": "efc3d07f-dbc6-45ed-ab21-4165b61667fc",
  "expHash1": "-7346afd1",
  "contents": {
    "sessionId": "6150ee00-657c-4cc3-98c3-534ef1334d87",
    "ids": {
      "firstGenCount": 9,
      "count": 1,
      "requestedClusterSize": 512,
      "localIdRanges": []
    }
  },
  "clientSequenceNumber": 1,
  "traces": [],
  "type": "idAllocation",
  "referenceSequenceNumber": 1,
  "timestamp": 1720800605952
}

The error we get is as follows

ERROR: TypeError: Cannot read properties of undefined (reading 'type')
    at processOp (/Users/arafat/arafat_project/CEDIT/FluidFramework-docker-compose-up/FluidFramework/packages/tools/fetch-tool/dist/fluidAnalyzeMessages.js:459:48)
    at DataStructureAnalyzer.processOp (/Users/arafat/arafat_project/CEDIT/FluidFramework-docker-compose-up/FluidFramework/packages/tools/fetch-tool/dist/fluidAnalyzeMessages.js:180:13)
    at printMessageStats (/Users/arafat/arafat_project/CEDIT/FluidFramework-docker-compose-up/FluidFramework/packages/tools/fetch-tool/dist/fluidAnalyzeMessages.js:378:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async fluidFetchOneFile (/Users/arafat/arafat_project/CEDIT/FluidFramework-docker-compose-up/FluidFramework/packages/tools/fetch-tool/dist/fluidFetch.js:37:5)

To Reproduce

Steps to reproduce the behavior:

  1. Clone https://github.com/microsoft/FluidExamples/tree/main/brainstorm
  2. Build and start the app using npm run start
  3. Create a document
  4. Use the document id in the fetch-tool (E.g. node dist/fluidFetch.js --dump:rawmessage --filter:messageType op --saveDir /Users/arafat/FluidFramework/packages/tools/fetch-tool/example 'http://localhost:3000/d/a0e5bd93-3f1c-44e3-b917-132a306d13d5')
  5. See the above mentioned error

Expected behavior

There should have been no error and instead the entire list of ops should have got printed on console

Logs

ERROR: TypeError: Cannot read properties of undefined (reading 'type')
    at processOp (/Users/arafat/arafat_project/CEDIT/FluidFramework-docker-compose-up/FluidFramework/packages/tools/fetch-tool/dist/fluidAnalyzeMessages.js:459:48)
    at DataStructureAnalyzer.processOp (/Users/arafat/arafat_project/CEDIT/FluidFramework-docker-compose-up/FluidFramework/packages/tools/fetch-tool/dist/fluidAnalyzeMessages.js:180:13)
    at printMessageStats (/Users/arafat/arafat_project/CEDIT/FluidFramework-docker-compose-up/FluidFramework/packages/tools/fetch-tool/dist/fluidAnalyzeMessages.js:378:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async fluidFetchOneFile (/Users/arafat/arafat_project/CEDIT/FluidFramework-docker-compose-up/FluidFramework/packages/tools/fetch-tool/dist/fluidFetch.js:37:5)

arafat-java avatar Jul 12 '24 16:07 arafat-java