getsentry / sentry-react-native

Official Sentry SDK for React-Native
https://sentry.io
MIT License
1.55k stars 325 forks source link

Sentry.captureException does not send logs immediately but on the next launch #392

Closed OrLevy23 closed 4 years ago

OrLevy23 commented 6 years ago

OS:

Platform:

Output of node -v && npm -v && npm ls --prod --depth=0

v9.3.0
1.5.1
yarn list v1.5.1
├─ @sentry/cli@1.30.4
├─ @sentry/wizard@0.9.5
├─ @types/react-native-popup-dialog@0.9.2
├─ @types/react-native@0.52.8
├─ @types/react@16.0.34
├─ abbrev@1.1.1
├─ absolute-path@0.0.0
├─ accepts@1.2.13
├─ agent-base@4.2.0
├─ ajv@5.5.2
├─ ansi-escapes@3.1.0
├─ ansi-gray@0.1.1
├─ ansi-regex@2.1.1
├─ ansi-styles@2.2.1
├─ ansi-wrap@0.1.0
├─ ansi@0.3.1
├─ anymatch@1.3.2
├─ aproba@1.2.0
├─ are-we-there-yet@1.1.4
├─ arr-diff@2.0.0
├─ arr-flatten@1.1.0
├─ array-differ@1.0.0
├─ array-filter@0.0.1
├─ array-map@0.0.0
├─ array-reduce@0.0.0
├─ array-uniq@1.0.3
├─ array-unique@0.2.1
├─ art@0.10.1
├─ asap@2.0.6
├─ asn1@0.2.3
├─ assert-plus@1.0.0
├─ async@2.6.0
├─ asynckit@0.4.0
├─ aws-sign2@0.7.0
├─ aws4@1.6.0
├─ axios@0.17.1
├─ babel-code-frame@6.26.0
├─ babel-core@6.26.0
├─ babel-generator@6.26.0
├─ babel-helper-builder-binary-assignment-operator-visitor@6.24.1
├─ babel-helper-builder-react-jsx@6.26.0
├─ babel-helper-call-delegate@6.24.1
├─ babel-helper-define-map@6.26.0
├─ babel-helper-explode-assignable-expression@6.24.1
├─ babel-helper-function-name@6.24.1
├─ babel-helper-get-function-arity@6.24.1
├─ babel-helper-hoist-variables@6.24.1
├─ babel-helper-optimise-call-expression@6.24.1
├─ babel-helper-regex@6.26.0
├─ babel-helper-remap-async-to-generator@6.24.1
├─ babel-helper-replace-supers@6.24.1
├─ babel-helpers@6.24.1
├─ babel-messages@6.23.0
├─ babel-plugin-check-es2015-constants@6.22.0
├─ babel-plugin-external-helpers@6.22.0
├─ babel-plugin-flow-react-proptypes@9.2.0
├─ babel-plugin-react-transform@3.0.0
├─ babel-plugin-syntax-async-functions@6.13.0
├─ babel-plugin-syntax-class-properties@6.13.0
├─ babel-plugin-syntax-dynamic-import@6.18.0
├─ babel-plugin-syntax-exponentiation-operator@6.13.0
├─ babel-plugin-syntax-flow@6.18.0
├─ babel-plugin-syntax-jsx@6.18.0
├─ babel-plugin-syntax-object-rest-spread@6.13.0
├─ babel-plugin-syntax-trailing-function-commas@6.22.0
├─ babel-plugin-transform-async-to-generator@6.16.0
├─ babel-plugin-transform-class-properties@6.24.1
├─ babel-plugin-transform-es2015-arrow-functions@6.22.0
├─ babel-plugin-transform-es2015-block-scoped-functions@6.22.0
├─ babel-plugin-transform-es2015-block-scoping@6.26.0
├─ babel-plugin-transform-es2015-classes@6.24.1
├─ babel-plugin-transform-es2015-computed-properties@6.24.1
├─ babel-plugin-transform-es2015-destructuring@6.23.0
├─ babel-plugin-transform-es2015-for-of@6.23.0
├─ babel-plugin-transform-es2015-function-name@6.24.1
├─ babel-plugin-transform-es2015-literals@6.22.0
├─ babel-plugin-transform-es2015-modules-commonjs@6.26.0
├─ babel-plugin-transform-es2015-object-super@6.24.1
├─ babel-plugin-transform-es2015-parameters@6.24.1
├─ babel-plugin-transform-es2015-shorthand-properties@6.24.1
├─ babel-plugin-transform-es2015-spread@6.22.0
├─ babel-plugin-transform-es2015-sticky-regex@6.24.1
├─ babel-plugin-transform-es2015-template-literals@6.22.0
├─ babel-plugin-transform-es2015-unicode-regex@6.24.1
├─ babel-plugin-transform-es3-member-expression-literals@6.22.0
├─ babel-plugin-transform-es3-property-literals@6.22.0
├─ babel-plugin-transform-exponentiation-operator@6.24.1
├─ babel-plugin-transform-flow-strip-types@6.22.0
├─ babel-plugin-transform-object-assign@6.22.0
├─ babel-plugin-transform-object-rest-spread@6.26.0
├─ babel-plugin-transform-react-display-name@6.25.0
├─ babel-plugin-transform-react-jsx-source@6.22.0
├─ babel-plugin-transform-react-jsx@6.24.1
├─ babel-plugin-transform-regenerator@6.26.0
├─ babel-plugin-transform-strict-mode@6.24.1
├─ babel-preset-es2015-node@6.1.1
├─ babel-preset-fbjs@2.1.4
├─ babel-preset-react-native@4.0.0
├─ babel-register@6.26.0
├─ babel-runtime@6.26.0
├─ babel-template@6.26.0
├─ babel-traverse@6.26.0
├─ babel-types@6.26.0
├─ babylon@6.18.0
├─ balanced-match@1.0.0
├─ base64-js@1.2.1
├─ base64-url@1.2.1
├─ basic-auth-connect@1.0.0
├─ basic-auth@1.0.4
├─ batch@0.5.3
├─ bcrypt-pbkdf@1.0.1
├─ beeper@1.1.1
├─ big-integer@1.6.28
├─ block-stream@0.0.9
├─ body-parser@1.13.3
├─ boom@2.10.1
├─ bplist-creator@0.0.7
├─ bplist-parser@0.1.1
├─ brace-expansion@1.1.11
├─ braces@1.8.5
├─ bser@2.0.0
├─ builtin-modules@1.1.1
├─ bytes@2.1.0
├─ camelcase@4.1.0
├─ caseless@0.12.0
├─ chalk@1.1.3
├─ chardet@0.4.2
├─ clamp@1.0.1
├─ cli-cursor@2.1.0
├─ cli-width@2.2.0
├─ cliui@3.2.0
├─ clone-stats@0.0.1
├─ clone@1.0.3
├─ co@4.6.0
├─ code-point-at@1.1.0
├─ color-convert@1.9.1
├─ color-name@1.1.3
├─ color-support@1.1.3
├─ combined-stream@1.0.5
├─ commander@2.13.0
├─ compressible@2.0.13
├─ compression@1.5.2
├─ concat-map@0.0.1
├─ concat-stream@1.6.0
├─ connect-timeout@1.6.2
├─ connect@2.30.2
├─ console-control-strings@1.1.0
├─ content-type@1.0.4
├─ convert-source-map@1.5.1
├─ cookie-parser@1.3.5
├─ cookie-signature@1.0.6
├─ cookie@0.1.3
├─ copy-paste@1.3.0
├─ core-js@2.5.3
├─ core-util-is@1.0.2
├─ crc@3.3.0
├─ create-react-class@15.6.3
├─ cross-spawn@5.1.0
├─ cryptiles@2.0.5
├─ csrf@3.0.6
├─ csurf@1.8.3
├─ dashdash@1.14.1
├─ dateformat@2.2.0
├─ debug@2.2.0
├─ decamelize@1.2.0
├─ decimal.js@9.0.1
├─ dedent@0.6.0
├─ deep-extend@0.4.2
├─ delayed-stream@1.0.0
├─ delegates@1.0.0
├─ denodeify@1.2.1
├─ depd@1.0.1
├─ destroy@1.0.4
├─ detect-indent@4.0.0
├─ detect-libc@1.0.3
├─ detect-newline@2.1.0
├─ dom-walk@0.1.1
├─ duplexer2@0.0.2
├─ ecc-jsbn@0.1.1
├─ ee-first@1.1.1
├─ encodeurl@1.0.1
├─ encoding@0.1.12
├─ envinfo@3.10.0
├─ error-ex@1.3.1
├─ errorhandler@1.4.3
├─ es6-promise@4.2.4
├─ es6-promisify@5.0.0
├─ escape-html@1.0.3
├─ escape-string-regexp@1.0.5
├─ esutils@2.0.2
├─ etag@1.7.0
├─ event-target-shim@1.1.1
├─ eventemitter3@3.0.1
├─ exec-sh@0.2.1
├─ execa@0.7.0
├─ expand-brackets@0.1.5
├─ expand-range@1.8.2
├─ express-session@1.11.3
├─ extend@3.0.1
├─ extendable-error@0.1.5
├─ external-editor@2.1.0
├─ extglob@0.3.2
├─ extsprintf@1.3.0
├─ fancy-log@1.3.2
├─ fast-deep-equal@1.0.0
├─ fast-json-stable-stringify@2.0.0
├─ fb-watchman@2.0.0
├─ fbjs-scripts@0.8.1
├─ fbjs@0.8.16
├─ figures@2.0.0
├─ filename-regex@2.0.1
├─ fill-range@2.2.3
├─ finalhandler@0.4.0
├─ find-up@2.1.0
├─ follow-redirects@1.4.1
├─ for-in@1.0.2
├─ for-own@0.1.5
├─ forever-agent@0.6.1
├─ form-data@2.3.1
├─ fresh@0.3.0
├─ fs-extra@1.0.0
├─ fs.realpath@1.0.0
├─ fsevents@1.1.3
├─ fstream-ignore@1.0.5
├─ fstream@1.0.11
├─ gauge@1.2.7
├─ get-caller-file@1.0.2
├─ get-stream@3.0.0
├─ getpass@0.1.7
├─ glob-base@0.3.0
├─ glob-parent@2.0.0
├─ glob@7.1.2
├─ global@4.3.2
├─ globals@9.18.0
├─ glogg@1.0.0
├─ graceful-fs@4.1.11
├─ growly@1.3.0
├─ gulp-util@3.0.8
├─ gulplog@1.0.0
├─ har-schema@2.0.0
├─ har-validator@5.0.3
├─ has-ansi@2.0.0
├─ has-flag@3.0.0
├─ has-gulplog@0.1.0
├─ has-unicode@2.0.1
├─ hawk@3.1.3
├─ hoek@4.2.0
├─ hoist-non-react-statics@2.3.1
├─ home-or-tmp@2.0.0
├─ hosted-git-info@2.5.0
├─ http-errors@1.3.1
├─ http-signature@1.2.0
├─ https-proxy-agent@2.2.1
├─ iconv-lite@0.4.21
├─ image-size@0.6.2
├─ imurmurhash@0.1.4
├─ inflight@1.0.6
├─ inherits@2.0.3
├─ ini@1.3.5
├─ inquirer@3.3.0
├─ invariant@2.2.2
├─ invert-kv@1.0.0
├─ is-arrayish@0.2.1
├─ is-buffer@1.1.6
├─ is-builtin-module@1.0.0
├─ is-dotfile@1.0.3
├─ is-equal-shallow@0.1.3
├─ is-extendable@0.1.1
├─ is-extglob@1.0.0
├─ is-finite@1.0.2
├─ is-fullwidth-code-point@2.0.0
├─ is-glob@2.0.1
├─ is-number@2.1.0
├─ is-posix-bracket@0.1.1
├─ is-primitive@2.0.0
├─ is-promise@2.1.0
├─ is-stream@1.1.0
├─ is-typedarray@1.0.0
├─ isarray@0.0.1
├─ isexe@2.0.0
├─ isobject@2.1.0
├─ isomorphic-fetch@2.2.1
├─ isstream@0.1.2
├─ jest-docblock@22.1.0
├─ jest-haste-map@22.1.0
├─ jest-worker@22.1.0
├─ js-tokens@3.0.2
├─ jsbn@0.1.1
├─ jsesc@1.3.0
├─ json-schema-traverse@0.3.1
├─ json-schema@0.2.3
├─ json-stable-stringify@1.0.1
├─ json-stringify-safe@5.0.1
├─ json5@0.4.0
├─ jsonfile@2.4.0
├─ jsonify@0.0.0
├─ jsprim@1.4.1
├─ kind-of@3.2.2
├─ klaw@1.3.1
├─ lcid@1.0.0
├─ left-pad@1.2.0
├─ load-json-file@2.0.0
├─ locate-path@2.0.0
├─ lodash._basecopy@3.0.1
├─ lodash._basetostring@3.0.1
├─ lodash._basevalues@3.0.0
├─ lodash._getnative@3.9.1
├─ lodash._isiterateecall@3.0.9
├─ lodash._reescape@3.0.0
├─ lodash._reevaluate@3.0.0
├─ lodash._reinterpolate@3.0.0
├─ lodash._root@3.0.1
├─ lodash.escape@3.2.0
├─ lodash.isarguments@3.1.0
├─ lodash.isarray@3.0.4
├─ lodash.keys@3.1.2
├─ lodash.pad@4.5.1
├─ lodash.padend@4.6.1
├─ lodash.padstart@4.6.1
├─ lodash.restparam@3.6.1
├─ lodash.template@3.6.2
├─ lodash.templatesettings@3.1.1
├─ lodash.throttle@4.1.1
├─ lodash@4.17.5
├─ loose-envify@1.3.1
├─ lottie-ios@2.5.0
├─ lottie-react-native@2.3.2
├─ lru-cache@4.1.2
├─ macos-release@1.1.0
├─ makeerror@1.0.11
├─ media-typer@0.3.0
├─ mem@1.1.0
├─ merge-stream@1.0.1
├─ merge@1.2.0
├─ method-override@2.3.10
├─ methods@1.1.2
├─ metro-core@0.24.7
├─ metro-source-map@0.24.7
├─ metro@0.24.7
├─ micromatch@2.3.11
├─ mime-db@1.33.0
├─ mime-types@2.1.17
├─ mime@1.6.0
├─ mimic-fn@1.2.0
├─ min-document@2.19.0
├─ minimatch@3.0.4
├─ minimist@1.2.0
├─ mkdirp@0.5.1
├─ mobx-react@4.3.5
├─ mobx@3.4.1
├─ moment@2.20.1
├─ morgan@1.6.1
├─ ms@0.7.1
├─ multiparty@3.3.2
├─ multipipe@0.1.2
├─ mute-stream@0.0.7
├─ nan@2.8.0
├─ negotiator@0.5.3
├─ node-fetch@1.7.3
├─ node-int64@0.4.0
├─ node-notifier@5.2.1
├─ node-pre-gyp@0.6.39
├─ nopt@4.0.1
├─ normalize-package-data@2.4.0
├─ normalize-path@2.1.1
├─ npm-run-path@2.0.2
├─ npmlog@2.0.4
├─ number-is-nan@1.0.1
├─ oauth-sign@0.8.2
├─ object-assign@4.1.1
├─ object.omit@2.0.1
├─ on-finished@2.3.0
├─ on-headers@1.0.1
├─ once@1.4.0
├─ onetime@2.0.1
├─ open@0.0.5
├─ opn@3.0.3
├─ optimist@0.6.1
├─ options@0.0.6
├─ os-homedir@1.0.2
├─ os-locale@2.1.0
├─ os-name@2.0.1
├─ os-tmpdir@1.0.2
├─ osenv@0.1.4
├─ p-finally@1.0.0
├─ p-limit@1.2.0
├─ p-locate@2.0.0
├─ p-try@1.0.0
├─ parse-glob@3.0.4
├─ parse-json@2.2.0
├─ parseurl@1.3.2
├─ path-exists@3.0.0
├─ path-is-absolute@1.0.1
├─ path-key@2.0.1
├─ path-to-regexp@1.7.0
├─ path-type@2.0.0
├─ pause@0.1.0
├─ pegjs@0.10.0
├─ performance-now@2.1.0
├─ pify@2.3.0
├─ plist@1.2.0
├─ preserve@0.2.0
├─ pretty-format@4.3.1
├─ private@0.1.8
├─ process-nextick-args@1.0.7
├─ process@0.5.2
├─ progress@2.0.0
├─ promise@7.3.1
├─ prop-types@15.6.0
├─ proxy-from-env@1.0.0
├─ pseudomap@1.0.2
├─ punycode@1.4.1
├─ qs@4.0.0
├─ r2@2.0.1
├─ random-bytes@1.0.0
├─ randomatic@1.1.7
├─ range-parser@1.0.3
├─ raven-js@3.24.1
├─ raw-body@2.1.7
├─ rc@1.2.3
├─ react-clone-referenced-element@1.0.1
├─ react-deep-force-update@1.1.1
├─ react-devtools-core@3.0.0
├─ react-native-animatable@1.2.4
├─ react-native-config@0.11.5
├─ react-native-device-info@0.21.2
├─ react-native-dismiss-keyboard@1.0.0
├─ react-native-drawer-layout-polyfill@1.3.2
├─ react-native-drawer-layout@1.3.2
├─ react-native-fast-image@4.0.0
├─ react-native-modal@5.0.0
├─ react-native-popup-dialog@0.11.46
├─ react-native-safe-area-view@0.6.0
├─ react-native-safe-module@1.2.0
├─ react-native-sentry@0.35.3
├─ react-native-tab-view@0.0.74
├─ react-native@0.52.3
├─ react-navigation@1.0.3
├─ react-proxy@1.1.8
├─ react-timer-mixin@0.13.3
├─ react-transform-hmr@1.0.4
├─ react@16.2.0
├─ read-env@1.1.1
├─ read-pkg-up@2.0.0
├─ read-pkg@2.0.0
├─ readable-stream@2.3.3
├─ regenerate@1.3.3
├─ regenerator-runtime@0.11.1
├─ regenerator-transform@0.10.1
├─ regex-cache@0.4.4
├─ regexpu-core@2.0.0
├─ regjsgen@0.2.0
├─ regjsparser@0.1.5
├─ remove-trailing-separator@1.1.0
├─ repeat-element@1.1.2
├─ repeat-string@1.6.1
├─ repeating@2.0.1
├─ replace-ext@0.0.1
├─ request@2.85.0
├─ require-directory@2.1.1
├─ require-main-filename@1.0.1
├─ response-time@2.3.2
├─ restore-cursor@2.0.0
├─ rimraf@2.6.2
├─ rndm@1.2.0
├─ run-async@2.3.0
├─ rx-lite-aggregates@4.0.8
├─ rx-lite@4.0.8
├─ rxjs@5.5.8
├─ safe-buffer@5.1.1
├─ safer-buffer@2.1.2
├─ sane@2.2.0
├─ sax@1.1.6
├─ semver@5.4.1
├─ send@0.13.2
├─ serialize-error@2.1.0
├─ serve-favicon@2.3.2
├─ serve-index@1.7.3
├─ serve-static@1.10.3
├─ set-blocking@2.0.0
├─ setimmediate@1.0.5
├─ shebang-command@1.2.0
├─ shebang-regex@1.0.0
├─ shell-quote@1.6.1
├─ shellwords@0.1.1
├─ signal-exit@3.0.2
├─ simple-plist@0.2.1
├─ slash@1.0.0
├─ slide@1.1.6
├─ sntp@1.0.9
├─ source-map-support@0.4.18
├─ source-map@0.5.7
├─ sparkles@1.0.0
├─ spdx-correct@1.0.2
├─ spdx-expression-parse@1.0.4
├─ spdx-license-ids@1.2.2
├─ sshpk@1.13.1
├─ stacktrace-parser@0.1.4
├─ statuses@1.5.0
├─ stream-buffers@2.2.0
├─ stream-counter@0.2.0
├─ string_decoder@1.0.3
├─ string-width@2.1.1
├─ stringstream@0.0.5
├─ strip-ansi@3.0.1
├─ strip-bom@3.0.0
├─ strip-eof@1.0.0
├─ strip-json-comments@2.0.1
├─ supports-color@2.0.0
├─ symbol-observable@1.0.1
├─ sync-exec@0.6.2
├─ tar-pack@3.4.1
├─ tar@2.2.1
├─ temp@0.8.3
├─ throat@4.1.0
├─ through@2.3.8
├─ through2@2.0.3
├─ time-stamp@1.1.0
├─ tmp@0.0.33
├─ tmpl@1.0.4
├─ to-fast-properties@1.0.3
├─ tough-cookie@2.3.3
├─ trim-right@1.0.1
├─ tsscmp@1.0.5
├─ tunnel-agent@0.6.0
├─ tweetnacl@0.14.5
├─ type-is@1.6.16
├─ typedarray-to-buffer@3.1.5
├─ typedarray@0.0.6
├─ ua-parser-js@0.7.17
├─ uglify-es@3.3.7
├─ uid-number@0.0.6
├─ uid-safe@2.0.0
├─ ultron@1.0.2
├─ unpipe@1.0.0
├─ util-deprecate@1.0.2
├─ utils-merge@1.0.0
├─ uuid@3.0.1
├─ validate-npm-package-license@3.0.1
├─ vary@1.0.1
├─ verror@1.10.0
├─ vhost@3.0.2
├─ vinyl@0.5.3
├─ walker@1.0.7
├─ watch@0.18.0
├─ whatwg-fetch@1.1.1
├─ which-module@2.0.0
├─ which@1.3.0
├─ wide-align@1.1.2
├─ win-release@1.1.1
├─ wordwrap@1.0.0
├─ wrap-ansi@2.1.0
├─ wrappy@1.0.2
├─ write-file-atomic@1.3.4
├─ ws@1.1.5
├─ xcode@0.9.3
├─ xmlbuilder@4.0.0
├─ xmldoc@0.4.0
├─ xmldom@0.1.27
├─ xpipe@1.0.5
├─ xtend@4.0.1
├─ y18n@3.2.1
├─ yallist@2.1.2
├─ yargs-parser@7.0.0
└─ yargs@9.0.1
✨  Done in 3.50s.

Config:

Sentry.config('https://...@sentry.io/...', {}).install()

I have following issue: We are working on a mobile app with kiosk mode (ipad) and the app does not open and closed regularly, I've encountered with an issue that Sentry.captureException pile the logs and only when we relaunch the app logs are sent.

Expected result: The logs should be sent immediately or once each certain time frame

HazAT commented 6 years ago

Thx for reporting this. This is indeed the current behavior, main reason for this is that if a real exception happens we don't want to wait until the to event is sent before the app crashes. Will think of something to fix this. As a workaround, if you call captureMessage from time to time or after captureException it should flush the queue.

HazAT commented 4 years ago

I am closing all old issues, please if this is still a problem feel free to revive it. Also, consider moving to our new SDK @sentry/react-native if it still happens there please open a new issue.

leedan77 commented 4 years ago

I found this problem is still happening in the new SDK, which is only happening on android. react-native: 0.59 @sentry/react-native: 1.3.0

HazAT commented 4 years ago

@leedan77 We just tried it and it's not true, it sends it directly.

leedan77 commented 4 years ago

@HazAT I found that it will delay the error sent just in Emulator, but immediately in real device. That's weird, but thx for your help.

0xTomDaniel commented 4 years ago

@HazAT This is still a problem for me on @sentry/react-native 1.3.3. I'd like captureException to send immediately if the app hasn't crashed.