-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multi client storage #290
Closed
Closed
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fa0afbb
test: test lookup of old file directory
fractalwrench 26e74e9
fix: change filestore to use multiple directories
fractalwrench 1fe4baa
test:
fractalwrench 71b363b
fix:
fractalwrench 7bc8576
refactor:
fractalwrench 45e8a35
refactor:
fractalwrench 9afb2be
test: mazerunner old error store test
fractalwrench f69ec3a
fix: retrieve all files when deleting oldest file
fractalwrench File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...unner/src/main/java/com/bugsnag/android/mazerunner/scenarios/MultiClientOldDirScenario.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.bugsnag.android.mazerunner.scenarios | ||
|
||
import android.content.Context | ||
import com.bugsnag.android.Client | ||
import com.bugsnag.android.Configuration | ||
import com.bugsnag.android.disableAllDelivery | ||
import com.bugsnag.android.writeErrorToOldDir | ||
|
||
/** | ||
* Configures two Bugsnag clients with different API keys. A single error report is written to the | ||
* old directory format, which should then be reported by both clients. | ||
* | ||
*/ | ||
internal class MultiClientOldDirScenario(config: Configuration, | ||
context: Context) : Scenario(config, context) { | ||
var firstClient: Client? = null | ||
var secondClient: Client? = null | ||
|
||
fun configureClients() { | ||
firstClient = Client(context, config) | ||
|
||
Thread.sleep(10) // enforce request order | ||
val secondConfig = Configuration("abc123") | ||
secondConfig.endpoint = config.endpoint | ||
secondConfig.sessionEndpoint = config.sessionEndpoint | ||
secondClient = Client(context, secondConfig) | ||
} | ||
|
||
override fun run() { | ||
configureClients() | ||
|
||
if ("DeliverReport" != eventMetaData) { | ||
disableAllDelivery(firstClient!!) | ||
disableAllDelivery(secondClient!!) | ||
writeErrorToOldDir(firstClient!!) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are multiple clients, will all attempt to find and send files from the "old" directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I've added a mazerunner scenario which covers this.