An aerosol-generating system comprising: an aerosol-generating device comprising: a device inner housing defining a device cavity ; a device airflow inlet extending through the device inner housing and in fluid communication with the device cavity ; an electrical heater ; and a device outer housing ; a cartridge assembly comprising: a cartridge assembly inner housing defining a substrate compartment ; an aerosol-forming substrate positioned within the substrate compartment ; and a cartridge assembly outer housing ; wherein a portion of the cartridge assembly inner housing is configured to be received within the device cavity ; wherein, when the portion of the cartridge assembly inner housing is received within the device cavity , at least a first part of a downstream edge of the device outer housing abuts at least a first part of an upstream edge of the cartridge assembly outer housing so that the cartridge assembly outer housing and the device outer housing form a system outer housing ; and wherein each device airflow inlet is a combined air inlet so that air entering through each device airflow inlet is divided into ventilation air and mainstream air, and wherein the device airflow inlet is configured for fluid communication with an upstream end of the substrate compartment and a downstream end of the substrate compartment when the at least a portion of the cartridge assembly inner housing is received within the device cavity , the mainstream air being directed to the upstream end of the substrate compartment, and the ventilation air being directed to the downstream end of the substrate compartment. an aerosol-generating device comprising: a device inner housing defining a device cavity ; a device airflow inlet extending through the device inner housing and in fluid communication with the device cavity ; an electrical heater ; and a device outer housing ; a device inner housing defining a device cavity ; a device airflow inlet extending through the device inner housing and in fluid communication with the device cavity ; an electrical heater ; and a device outer housing ; a cartridge assembly comprising: a cartridge assembly inner housing defining a substrate compartment ; an aerosol-forming substrate positioned within the substrate compartment ; and a cartridge assembly outer housing ; a cartridge assembly inner housing defining a substrate compartment ; an aerosol-forming substrate positioned within the substrate compartment ; and a cartridge assembly outer housing ; wherein a portion of the cartridge assembly inner housing is configured to be received within the device cavity ; wherein, when the portion of the cartridge assembly inner housing is received within the device cavity , at least a first part of a downstream edge of the device outer housing abuts at least a first part of an upstream edge of the cartridge assembly outer housing so that the cartridge assembly outer housing and the device outer housing form a system outer housing ; and wherein each device airflow inlet is a combined air inlet so that air entering through each device airflow inlet is divided into ventilation air and mainstream air, and wherein the device airflow inlet is configured for fluid communication with an upstream end of the substrate compartment and a downstream end of the substrate compartment when the at least a portion of the cartridge assembly inner housing is received within the device cavity , the mainstream air being directed to the upstream end of the substrate compartment, and the ventilation air being directed to the downstream end of the substrate compartment. <EOS>