Skip to content

Commit c5cfe19

Browse files
committed
fix: OracleP*C* now provides subscribeEvents: true for post-connect narrate
1 parent e35b197 commit c5cfe19

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

packages/prophet/AuthorityProphet/AuthorityNexus.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ export default class AuthorityNexus extends LogEventGenerator {
120120
if (!authorityConfig) {
121121
throw new Error(`No Valaa authority config found for "${String(authorityURI)}"`);
122122
}
123-
return schemeModule.createAuthorityProphet({ authorityURI, authorityConfig, nexus: this });
123+
return schemeModule.createAuthorityProphet({
124+
authorityURI, authorityConfig, nexus: this,
125+
verbosity: authorityConfig.hasOwnProperty("verbosity")
126+
? authorityConfig.verbosity : this.getVerbosity(),
127+
});
124128
} catch (error) {
125129
throw this.wrapErrorEvent(error, `createAuthorityProphet("${String(authorityURI)}")`,
126130
"\n\tschemeModule:", schemeModule,

packages/prophet/Oracle/OraclePartitionConnection.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ export default class OraclePartitionConnection extends PartitionConnection {
4040
// logic (defined in PartitionConnection.js) and begin I/O bound(?)
4141
// scribe event log narration in parallel to the authority
4242
// proxy/connection creation.
43+
const subscribeEvents = (options.subscribeEvents !== false);
4344
this.setUpstreamConnection(this._authorityProphet.acquirePartitionConnection(
4445
this.getPartitionURI(), {
4546
subscribeEvents: false, narrateOptions: false,
4647
receiveTruths: this.getReceiveTruths(options.receiveTruths),
4748
}));
4849
return thenChainEagerly(
4950
this._upstreamConnection.getActiveConnection(),
50-
() => this.narrateEventLog(options.narrateOptions));
51+
() => this.narrateEventLog({ subscribeEvents, ...options.narrateOptions }));
5152
}
5253

5354
receiveTruths (truths: EventBase[], retrieveMediaBuffer: RetrieveMediaBuffer,

packages/prophet/api/types.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ export type NarrateOptions = {
4444
receiveCommands?: ReceiveEvents, // default: receiveTruths. Callback for re-narrated commands
4545
eventIdBegin?: number,
4646
eventIdEnd?: number,
47+
subscribeEvents?: boolean // if provided will enable or disable event subscriptions.
48+
// TODO(iridian, 2019-01): This (c|sh)ould be extracted to its
49+
// own separate function. Now this flag is awkwardly present
50+
// both here and in ConnectOptions.
4751
};
4852

4953
export type ChronicleOptions = NarrateOptions & {

0 commit comments

Comments
 (0)