Skip to content

Conversation

@mbani01
Copy link
Contributor

@mbani01 mbani01 commented Dec 22, 2025

This pull request makes several improvements to the StackOverflow integration, primarily enhancing logging for better observability, adjusting the integration's polling frequency, and updating a configuration constant. These changes aim to make the integration more transparent, responsive, and configurable.

Logging and Observability Improvements:

  • Added detailed logging to the generateStreams handler in generateStreams.ts, including logs for start, per-tag and per-keyword stream publishing, and completion, along with relevant metadata such as integration ID, tags, keywords, and number of streams published.

Configuration and Scheduling Adjustments:

  • Reduced the checkEvery interval in the StackOverflow integration descriptor from 6 hours to 1 hour, making the integration poll for new data more frequently (index.ts).
  • Updated the STACKOVERFLOW_MAX_RETROSPECT_IN_HOURS constant from 7 to 5 hours, decreasing the retrospective window for data fetching (types.ts).

Note

Enhances StackOverflow integration with detailed logs, enforces presence of API key, shortens polling interval to 1h, and reduces retrospect window to 5h.

  • StackOverflow integration:
    • Observability: Add structured logs in api/getQuestions.ts, api/getQuestionsByKeywords.ts, generateStreams.ts, and processStream.ts (request details with masked key, response metrics, stream publishing, and counts).
    • Config validation: Use optional chaining for platformSettings?.key; log checks and throw explicit error when key is missing.
    • Scheduling: Change checkEvery in index.ts from 360 to 60 (poll hourly).
    • Retrospect window: Update STACKOVERFLOW_MAX_RETROSPECT_IN_HOURS in types.ts from 7 to 5.

Written by Cursor Bugbot for commit f962c4f. This will update automatically on new commits. Configure here.

@mbani01 mbani01 self-assigned this Dec 22, 2025
@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

2 similar comments
@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

ctx.log.info(
{ url: config.url, params: { ...config.params, key: '***' } },
'StackOverflow: Making API call (tags)',
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OAuth access token exposed in log output

The new logging statement masks the API key with '***' but fails to mask the access_token which was added to params at lines 90-92. When an OAuth token is obtained from Nango, it gets logged in plaintext via the { ...config.params, key: '***' } spread. The access_token property remains exposed in the logged object, potentially allowing anyone with log access to obtain valid authentication credentials.

Additional Locations (1)

Fix in Cursor Fix in Web

@mbani01 mbani01 closed this Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants