RGPosadas / Mull

MIT License
8 stars 5 forks source link

BUG-27: EventChannels aren't always getting created when creating a new event #349

Closed RGPosadas closed 3 years ago

RGPosadas commented 3 years ago

Describe The Bug

When manually creating an event, new EventChannels must be created (one for Group Chat and one for Announcements). However, instead of creating new EventChannels, the first set of EventChannels get updated with the new eventId.

To Reproduce

Steps to reproduce the behavior:

  1. Create an event
  2. You'll see that the first set of EventChannels simply gets updated with the newly created eventId

List of newly created events:

{
  description: 's',
  endDate: 2021-05-07T16:00:00.000Z,
  image: { id: 1, mediaType: 'png' },
  location: {
    placeId: 'ChIJD98cx4rJWTkRO62Tvs8V3XY',
    title: 'Rajkot, Gujarat, India',
    id: 1
  },
  restriction: 0,
  startDate: 2021-04-16T16:00:00.000Z,
  title: 'kubes',
  host: { id: 1 },
  channels: [
    { name: 'Announcements', rights: 0, id: 1 },
    { name: 'Group Chat', rights: 1, id: 2 }
  ],
  id: 1
}
{
  description: 'pikachu',
  endDate: 2021-04-24T16:00:00.000Z,
  image: { id: 2, mediaType: 'gif' },
  location: {
    placeId: 'ChIJ7aCNjwniDDkRmqgROpYMHTo',
    title: 'SDA Market, Block C 5, Hauz Khas Enclave, Hauz Khas, New Delhi, Delhi, India',
    id: 2
  },
  restriction: 0,
  startDate: 2021-04-23T16:00:00.000Z,
  title: 'pikachu',
  host: { id: 1 },
  channels: [
    { name: 'Announcements', rights: 0, id: 1 },
    { name: 'Group Chat', rights: 1, id: 2 }
  ],
  id: 2
}
{
  description: 'dfs',
  endDate: 2021-04-24T16:00:00.000Z,
  image: { id: 3, mediaType: 'png' },
  location: {
    placeId: 'ChIJbxbxOv2jc0gRkp0bOdZvBZ0',
    title: 'FDS Waste Services, Mannings Heath Road, Poole, UK',
    id: 3
  },
  restriction: 0,
  startDate: 2021-04-23T16:00:00.000Z,
  title: 'Testing',
  host: { id: 1 },
  channels: [
    { name: 'Announcements', rights: 0, id: 1 },
    { name: 'Group Chat', rights: 1, id: 2 }
  ],
  id: 3
}
{
  description: 'ds',
  endDate: 2021-04-10T16:00:00.000Z,
  image: { id: 4, mediaType: 'png' },
  location: {
    placeId: 'ChIJrw7QBK9YXIYRvBagEDvhVgg',
    title: 'San Antonio, TX, USA',
    id: 4
  },
  restriction: 0,
  startDate: 2021-04-09T16:00:00.000Z,
  title: 'giraff-e',
  host: { id: 1 },
  channels: [
    { name: 'Announcements', rights: 0, id: 1 },
    { name: 'Group Chat', rights: 1, id: 2 }
  ],
  id: 4
}

Expected Behavior

New set of EventChannels gets created for each event.

Bug Handling Strategy

cristian-aldea commented 3 years ago

+1 this is really important to fix