Skip to content

Fix event ordering: Emit ProjectCreated before other project events #84

@hudsonhrh

Description

@hudsonhrh

Problem

When creating a project in the TaskManager contract, events are emitted in the following order:

  1. ProjectManagerUpdated
  2. ProjectRolePermSet
  3. BountyCapSet
  4. ProjectCreated

This causes issues for subgraph indexing and any other event consumers that expect ProjectCreated to fire first. The subgraph currently requires a workaround (ensureProjectExists()) to handle this.

Expected Behavior

ProjectCreated should be emitted before any other project-related events (ProjectManagerUpdated, ProjectRolePermSet, BountyCapSet).

Why This Matters

  1. Logical ordering: The entity should exist before it's configured
  2. Simpler subgraph code: No need for stub creation workarounds
  3. Better for all consumers: Any service listening to these events benefits

Suggested Fix

In the project creation function, emit ProjectCreated first, before emitting other configuration events.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions