title: PagingDataAdapter.submitData not adding data
body: <p>I'm using Paging 3 from the jetpack libraries, after inserting a data to room db, collectLatest gets called but after adding data with PagingDataAdapter.submitData, it doesn't seem to add to the adapter. I tried using adapter.refresh and adpter.notifyDatSetChanged, it's not working either, below is the full code.</p>
  <pre><code>viewModel.incomingMessagingEvent.observe(
              viewLifecycleOwner,
              Observer { incomingMessage -&gt;
                  incomingMessage?.let {
                      lifecycleScope.launch(Dispatchers.IO) {
                          viewModel.insertNewMessage(incomingMessage)
                      }
                  }
              })
  </code></pre>
  <pre><code>suspend fun insertNewMessage(directMessage: DirectMessage) {
          directMessagingRepository.messagesLatestDataBase.directMessageDao().insert(directMessage)
      }
  </code></pre>
  <pre><code>@Entity(tableName = &quot;direct_message_table&quot;)
  @TypeConverters(LumTypeConverters::class)
  @Parcelize
  data class DirectMessage(
  
      @PrimaryKey(autoGenerate = true)
      val dbRowId: Int = 0,
  
      @SerializedName(&quot;id&quot;) val id: Int? = null,
      @SerializedName(&quot;text&quot;) val text: String? = null,
      @SerializedName(&quot;group_id&quot;) val group_id: Int? = null,
      @SerializedName(&quot;user_id&quot;) val user_id: Int? = null,
      @SerializedName(&quot;message_type&quot;) val message_type: DirectMessageType? = null,
      @SerializedName(&quot;message_images&quot;) val message_images: List&lt;LumAsset&gt;? = null,
      @SerializedName(&quot;playlist&quot;) val playList: Playlist? = null,
      @SerializedName(&quot;user&quot;) val user: User? = null,
      @SerializedName(&quot;album&quot;) val album: Album? = null,
      @SerializedName(&quot;media&quot;) val media: Track? = null,
      @SerializedName(&quot;message_has_media&quot;) val message_has_media: Boolean? = null,
      @SerializedName(&quot;source_media_id&quot;) val source_media_id: Int? = null,
      @SerializedName(&quot;source_activity_id&quot;) val source_activity_id: Int? = null,
      @SerializedName(&quot;source_user_id&quot;) val source_user_id: Int? = null,
      @SerializedName(&quot;source_album_id&quot;) val source_album_id: Int? = null,
      @SerializedName(&quot;author_name&quot;) val author_name: String? = null,
      @SerializedName(&quot;author_handle&quot;) val author_handle: String? = null,
      @SerializedName(&quot;author_role_id&quot;) val author_role_id: Int? = null,
      @SerializedName(&quot;author_user_id&quot;) val author_user_id: Int? = null,
      @SerializedName(&quot;author_profile_url&quot;) val author_profile_url: String? = null,
      @SerializedName(&quot;created_at&quot;) val created_at: String? = null,
      @SerializedName(&quot;message_attachment_subtitle&quot;) val message_attachment_subtitle: String? = null,
      @SerializedName(&quot;author&quot;) val author: Author? = null,
      @SerializedName(&quot;activity&quot;) val activity: FeedActivity? = null
  ) : Parcelable
  </code></pre>
  <pre><code>@Dao
  interface DirectMessageDao {
  
      @Insert(onConflict = OnConflictStrategy.REPLACE)
      suspend fun insert(directMessage: DirectMessage)
  
      @Query(&quot;SELECT * FROM direct_message_table&quot;)
      suspend fun getDirectMessages(): List&lt;DirectMessage&gt;
  
      @Query(&quot;SELECT * FROM direct_message_table where id=:messageId &quot;)
      suspend fun getGroupOnId(messageId: Int): List&lt;DirectMessage&gt;
  
      @Query(&quot;SELECT * FROM direct_message_table&quot;)
      fun getDirectMessageAsPagingSource(): PagingSource&lt;Int, DirectMessage&gt;
  
      @Query(&quot;SELECT * FROM direct_message_table&quot;)
      fun getDirectMessageList(): DataSource.Factory&lt;Int, DirectMessage&gt;
  
      @Insert
      suspend fun insertAll(groups: List&lt;DirectMessage&gt;)
  
      @Delete
      suspend fun delete(directMessageGroup: DirectMessage)
  
      @Query(&quot;DELETE FROM direct_message_table&quot;)
      suspend fun deleteAll()
  
      @Query(&quot;DELETE FROM direct_message_table where id=:messageId&quot;)
      suspend fun deleteGroup(messageId: Int)
  
      @Update
      suspend fun update(directMessageGroup: DirectMessage)
  }
  </code></pre>
  <pre><code>lateinit var conversationsFlow: Flow&lt;PagingData&lt;DirectMessage&gt;&gt;
  
      fun getConversationsAsFlow(groupId: Int) {
          conversationsFlow = Pager(
              PagingConfig(
                  prefetchDistance = LumConstants.PAGE_SIZE,
                  initialLoadSize = LumConstants.INITIAL_LOAD_ITEMS,
                  pageSize = LumConstants.PAGE_SIZE
              ),
              remoteMediator = GroupConversationRemoteMediator(
                  groupId,
                  directMessagingRepository.messagesLatestDataBase,
                  NetworkService.directMessageNetworkInterface
              )
          ) {
              directMessagingRepository.messagesLatestDataBase.directMessageDao()
                  .getDirectMessageAsPagingSource()
          }.flow
      }
  </code></pre>
  <pre><code>class GroupConversationRemoteMediator(
      private val groupId: Int,
      private val database: MessagesDatabase,
      private val directMessageNetworkInterface: DirectMessageNetworkInterface
  ) : RemoteMediator&lt;Int, DirectMessage&gt;() {
  
      private val dao = database.directMessageDao()
      var nextUrl: String? = null
  
      override suspend fun load(
          loadType: LoadType,
          state: PagingState&lt;Int, DirectMessage&gt;
      ): MediatorResult {
  
          try {
              // Get the closest item from PagingState that we want to load data around.
              val loadKey = when (loadType) {
                  LoadType.REFRESH -&gt; null
                  LoadType.PREPEND -&gt; return MediatorResult.Success(endOfPaginationReached = true)
                  LoadType.APPEND -&gt; {
                      if (nextUrl == null) {
                          return MediatorResult.Success(endOfPaginationReached = true)
                      }
                      nextUrl
                  }
              }
  
              val data =
                  if (loadKey != null)
                      directMessageNetworkInterface.getMoreConversationsAsync(loadKey)
                          .await()
                  else
                      directMessageNetworkInterface.getConversationsAsync(groupId).await()
  
              database.withTransaction {
                  if (loadType == LoadType.REFRESH) {
                      dao.deleteAll()
                      nextUrl = null
                  }
  
                  if (data.success) {
                      nextUrl = data.data.list.next_page_url
                      dao.insertAll(data.data.list.data.map {
                          it
                      })
                  } else {
                      nextUrl = null
                  }
  
              }
  
              return MediatorResult.Success(endOfPaginationReached = if (data.success) data.data.list.data.isEmpty() else true)
          } catch (e: IOException) {
              return MediatorResult.Error(e)
          } catch (e: HttpException) {
              return MediatorResult.Error(e)
          }
      }
  }
  </code></pre>
  <pre><code>        viewModel.conversationsFlow.collectLatest {
                 adapter.submitData(it)
             
          }
  </code></pre>
  <pre><code>class ChatDiffUtilCallback : DiffUtil.ItemCallback&lt;DirectMessage&gt;() {
      override fun areItemsTheSame(
          oldItem: DirectMessage,
          newItem: DirectMessage
      ): Boolean =
          oldItem.id == newItem.id
  
      override fun areContentsTheSame(
          oldItem: DirectMessage,
          newItem: DirectMessage
      ): Boolean =
          oldItem == newItem
  }
  </code></pre>