Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17046] CLI: Analytics fails to send if event data greater than 8KB

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-06-20T21:36:28.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sRelease 3.3.0, Release 3.4.0
ComponentsCLI
Labelsmodule_cli, qe-testadded
ReporterChris Barber
AssigneeChris Barber
Created2014-05-30T05:16:21.000+0000
Updated2014-06-27T20:59:25.000+0000

Description

With the introduction of TIMOB-16617, we can now collect Titanium API usage, however the data generated is greater than 8KB which is causing issues when forking the analytics send process. The Titanium CLI needs to move the sending of analytics from the process.on('exit') event to a callback that is fired after the command finishes. We also need to rework node-appc's analytics library so that the parent process writes the analytics events to disk, then forks the analytics send process with the minimal amount of data.

Comments

  1. Chris Barber 2014-05-30

    node-appc master pull request: https://github.com/appcelerator/node-appc/pull/93 Titanium CLI master pull request: https://github.com/appcelerator/titanium/pull/139 Titanium CLI 3_3_X pull request: https://github.com/appcelerator/titanium/pull/140 To test, *you MUST build a Titanium SDK that has TIMOB-16617*, then build an app for various platforms:
       ti build -p android --build-only --config {cli:{analytics:{debug:true}}}
       ti build -p ios --build-only --config {cli:{analytics:{debug:true}}}
       ti build -p mobileweb --build-only --config {cli:{analytics:{debug:true}}}
       
  2. Tim Poulsen 2014-06-18

    Analytics are sent, but: ti config no longer shows the cli.sendAPIUsage variable initially, though once you set it with ti config cli.sendAPIUsage true you see the variable with ti config ti config never exits, nor does ti sdk select or ti build You have to press Ctrl-C to break out. It doesn't matter if you add additional arguments (like doing ti config cli.sendAPIUsage true you still have to Ctrl-C out). Adding --config \{cli:\{analytics: \{debug:true}}} doesn't seem to do anything. With or without it, I had to add the console.log(payload) statement to analytics.js as described in the earlier comment to see any analytics output.
  3. Chris Barber 2014-06-18

    [~skypanther] As with all Titanium CLI config options, if the config option does not explicitly exist, then the default is used. Just to be clear, you need to running the Titanium CLI from git with my changes and then put the node-appc from git (plus my changes) in the Titanium CLI's node_modules directory and make sure the npm dependencies are installed:
       git clone git@github.com:appcelerator/node-appc.git
       cd node-appc
       git checkout --track origin/timob-17046
       npm install
       
       cd ..
       
       git clone git@github.com:appcelerator/titanium.git
       cd titanium
       git checkout --track origin/timob-17046_3_3_X
       npm install
       rm -rf node_modules/node-appc
       cp -r ../node-appc node_modules/
       sudo npm link
       
    Now you should be able to run the CLI and the analytics will be sent correctly.
  4. Chris Barber 2014-06-19

    So generate larger than 8KB of data, you must use a TiSDK that includes the PR from TIMOB-16617 and do a production/dist build.
  5. Tim Poulsen 2014-06-20

    Works as described
  6. Samuel Dowse 2014-06-27

    Verified on: Mac OSX 10.9.3 Appcelerator Studio, build: 3.3.0.201406231625 Titanium SDK, build: 3.3.0.v20140627094114 Titanium CLI, build: 3.3.0-rc3 Alloy: 1.4.0-rc2 Used KitchenSink to generate and send large Analytic data. Data sent successfully. Closing.

JSON Source